pocompendium(1)

πŸ’– pocompendium(1) β€” the PO compendium maker πŸ’–

okay bestie, gather round, because pocompendium is here from the Translate Toolkit 1.3.0 and she is so useful it's unreal. she takes a whole directory of translated PO files and squishes them into ONE glorious PO file called a PO compendium. it's giving ✨organization✨.


🌸 NAME 🌸

pocompendium β€” creates a PO compendium from a directory of PO files. that's it, that's the job, and she does it flawlessly. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

pocompendium [options] output.po <-d po-directory(ies)|po-file(s)>

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea: pocompendium takes a directory of translated PO files and creates a single PO file called a PO compendium. no cap.

and what do you do with that gorgeous thing? two things, both iconic:

  • you can use it to review word choice conflicts β€” like, spot where you translated the same vibe two different ways πŸ‘€
  • or you can feed it as input during a merge using pomigrate(1)

that's the whole concept. simple, clean, main character energy. 🫢


✨ OPTIONS ✨

  • -v, --invert β€” creates an inverse compendium with msgid and msgstr swapped. flips the whole thing, lowkey chaotic, highkey useful. πŸ”„
  • -e, --errors β€” only outputs message bundles that have conflicts. drama detector fr fr. πŸ’€
  • -c, --correct β€” only outputs message bundles that are correctly translated. the good ones, the ones that ate. βœ…
  • -i, --ignore-case β€” drops all strings to lowercase. everyone's equal now, no more shouting. πŸ”‘
  • -st, -tilde, --strip-accel-amp β€” remove all & style accelerator markers. bye bye ampersands πŸŽ€
  • -sa, -amp, --strip-accel-tilde β€” remove all ~ style accelerator markers. tilde? never heard of her 🌸
  • -su, --strip-accel-under β€” remove all _ style accelerator markers. underscore, you're dismissed πŸ’…

🌈 EXAMPLES 🌈

πŸ“ Compendium creation

create a compendium with all your translations to use as input during a message merge β€” whether you're migrating an existing project or starting a brand new one. glow up either way. ✨

πŸ’€ Conflicting translations

use --errors to find where you have translated an English string differently. ngl, a lot of the time this is totally fine and okay! but often it will pick up subtle spelling mistakes, or help you migrate older translations to a newer choice of words. so like… it's a vibe check on your past self. πŸ™ˆ

🧚 Conflicting word choice

use --invert and --errors together to get a compendium file that shows how you have used a translated word for different English words. maybe you chose a word that's valid for both English expressions β€” but in the context of computers it would cause confusion for the user 😭. now you can easily identify these words and make changes in the underlying translations. slay, problem solved.

πŸ”₯ Narrowing Results

PO files treat slight changes in capitalisation, accelerator, punctuation and whitespace as different translations. wild, right? in cases 2) and 3) above it's sometimes useful to remove the inconsistencies so you can focus on the actual errors in translation and not on shifts in capitals.

to this end you can use the following: --ignore-case, --strip-accel-amp, --strip-accel-tilde, --strip-accel-under. pick your fighter. 🫢


⭐ OPERATION ⭐

so how does the magic actually happen? pocompendium makes use of the Gettext tool msgcat(1) to perform its task. it traverses the PO directories and cat's all found PO files into the single compendium output file. then it uses msgattrib(1) to extract only certain messages, msghack to invert messages, and msgfilter(1) to convert messages to lowercase.

it's a whole little pipeline and honestly? the teamwork is unmatched. πŸ‘‘


πŸŽ€ BUGS πŸŽ€

there are some absolute/relative path name issues. 😭 not her fault, but bestie, be aware. path drama is real.

okay that's the whole page!! she's a queen, she's a compendium maker, she's from Translate Toolkit 1.3.0 and this page is dated right along with that release. go forth and make compendiums, bestie πŸ’–βœ¨