pospell(1)

✨ pospell(1) β€” the user manual, bestie edition ✨

okay so you know how translation files (.po files, we love them) are full of words that absolutely need spellchecking but nobody wants to do it by hand? yeah. that's what pospell is for. it's a little helper from the User Manuals section of your friendly neighborhood man pages, and it's about to be your new best friend. 🫢


🌸 NAME 🌸

pospell β€” run a program on the translation strings of a .po-file πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

pospell [-l language ] [-fsv] -n pofile -p program [-- [ arguments...
]]

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the whole vibe. pospell takes the translations out of pofile, drops them into a temporary file (we call this the spellfile, iconic name, no notes), and then calls program with its arguments. program is supposed to somehow change the spellfile β€” typically it's a spell checker, because duh. 🧚 afterwards, the possibly-changed translations in the spellfile get copied right back into pofile. it's giving round trip. it's giving teamwork.

if pofile is specified as - then pospell will act as a filter, i.e. standard input and standard output will be used. very pipes-and-fifos of it.

%f in the arguments will be expanded to the name of the spellfile, or - if the -f option is used. use %% for a real % character. don't skip this part bestie, it matters. ⭐

now the important structural tea. all comment lines in the pofile are replaced with lines with # as the only character in the spellfile. the msgid strings with original text in the pofile are replaced with lines with > and ] as the only characters in the spellfile. the msgstr strings with file headers (i.e. strings without corresponding msgid strings) are replaced with lines with ) and ] as the only characters in the spellfile.

🚨 do NOT change or remove these lines from the spellfile β€” they are used when the spellfile and the pofile are merged together after running the program. they are load-bearing. do not touch. fr fr. πŸ’€

the normal msgstr strings are copied to the spellfile with some changes, and there are exactly three, so let's count them down:

  1. the word msgstr and everything else before the string is replaced by a + character.
  2. strings with C escape sequences followed by a letter like "one\ttwo" are split to parts like "one\t" "two".
  3. leading whitespace in continuation lines is removed.

the changes of kind 1) and 2) are undone when the spellfile is copied back into the pofile, but removed whitespace will not be restored. 😭 that whitespace is gone forever, she's not coming back, we mourned her, we moved on.


πŸ’… OPTIONS πŸ’…

  • -f β€” the called program is a filter, so don't make a temporary file β€” instead pipe the spellfile to its standard input and read it back from its standard output. main character streaming energy. πŸ”₯
  • -l language β€” only translations with the indicated language code are copied to the spellfile. pick your language, queen. πŸ‘‘
  • -s β€” quit with an error message if unrecognized items are found in the pofile or spellfile. strict mode, no nonsense, we respect it. ✨
  • -v β€” print the version and exit. short and sweet, honestly goals.

πŸ“ FILES πŸ“

pospell uses one or two temporary files with names given by the mkstemp(3) or the tmpnam(3) function. yes bestie, plural, one or two, it depends. it's flexible like that. 🌈


πŸ™ˆ BUGS πŸ™ˆ

if some system call gives an unexpected error, pospell will stop immediately with an error message leaving its temporary files. 🫠 so like… they're just sitting there. chilling. unsupervised. consider yourself warned.


πŸ’œ AUTHOR πŸ’œ

by Byrial Jensen <byrial@image.dk> β€” absolute legend, we stan. 🫢


🌟 SEE ALSO 🌟


and that's the whole page, bestie!! this one came out of the Unix manual and it's dated APRIL 2000, which is lowkey ancient but the tips still slay. go spellcheck those translations. periodt. πŸŽ€βœ¨πŸ’–