DEBCONF-GETTEXTIZE(1)

✨ DEBCONF-GETTEXTIZE ✨

okay bestie, so this is debconf-gettextize from the po-debconf squad πŸ’… and it's literally the glow-up machine that pulls all your debconf template translations out into cute lil PO files. no cap.


🌸 SYNOPSIS 🌸

debconf-gettextize [-v] [-h] [--podir=DIR] [--choices] [--merge] master
[master ...]

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the lore 🫢 Those /var/lib/dpkg/info/*.templates files that debconf reads? They're messy β€” English text AND translations all crammed into the same file. And like, in source packages you want translations living in their own separate files so the translators don't have to fight anybody. that's just basic respect for the girlies doing the translating, honestly.

In the initial implementation (the old days, the pre-glow-up era 😭), a master templates file had only English text, and templates.xx files had both the original AND the translated strings for language xx. The program debconf-mergetemplate was the one smooshing master and translated templates files together.

Then came the new implementation with "po-debconf", and it's based on "gettext" ✨ Maintainers mark translatable fields by prepending them with an underscore, English strings get automatically extracted into a POT file, translators work on normal PO files like civilized people, and po2debconf generates a merged templates file with the exact same structure. iconic behavior, truly.

The debconf-gettextize program was initially designed to help migrating to the new implementation. and the way it does that is:

  • It reads a list of master files and their associated translations, and generates po/*.po files for each language containing translated strings. πŸ’–
  • Each input file receives an .old suffix, and a new master file overwrites the old one. That new file is identical to the previous master file except that an underscore is prepended to translatable fields. Then developers can choose which fields translators have to work on, and which ones get skipped because their values are not locale-dependent. main character energy, honestly.
  • A po/POTFILES.in file is also created, and it contains the list of templates files debconf-updatepo has to process. πŸŽ€

Typically you run debconf-gettextize only once, when you're transforming from the first implementation into the "po-debconf" format. but bestie, it can also be used afterwards to transform a _Choices field into __Choices (or vice-versa 😳) without losing any translations β€” that's when you use the --merge flag, alongside --choices or not, whatever your heart says.

So for that, the desired template containing the _Choices or __Choices fields you want to modify has to be copied into a temporary template file, which gets passed to debconf-gettextize as an argument. Then these steps happen:

  1. po2debconf is run on this template file to generate a translated templates file. 🧚
  2. This translated templates file is processed as described above, and PO files are generated.
  3. Newly created PO files are merged with existing ones. slay.
When PO files are merged, _Choices fields have to be replaced by __Choices (or vice-versa) in the original templates file before running debconf-updatepo β€” otherwise new translations will be fuzzy. πŸ’€ not fuzzy bestie. nobody wants that.

πŸ’… OPTIONS πŸ’…

  • -h, --help β€” shows you a usage summary for the program and then dips. bye πŸ‘‹
  • -v, --verbose β€” processes in verbose mode, so it actually tells you what it's doing. talkative queen.
  • --podir=DIR β€” sets the directory for PO files. The default is to go searching for PO files in the po subdirectory below the location of the first master file. πŸ”
  • --choices β€” by default, debconf-gettextize replaces Choices fields with _Choices. With this flag though, __Choices fields get written instead. two underscores, we're fancy now ✨
  • --merge β€” when this flag is set, the strings are merged with existing PO files. The templates files and po/POTFILES.in are not modified. πŸ™ˆ

⚠️ CAVEATS ⚠️

The Default field is special when the template type is Select or Multiselect, because a value has to be chosen amongst the English list of choices β€” even for localized values. Normally this field must not be changed, but in rare circumstances localized values are meaningful (e.g. to choose the default language of an application). πŸ‘‘

So in order to let translators know that this localized Default field is special, you must by convention call it _DefaultChoice instead of _Default. remember it, it's giving secret handshake 🀝


πŸ”₯ SEE ALSO πŸ”₯

debconf-updatepo(1), po2debconf(1), debconf-devel(7), po-debconf(7).

iykyk πŸ’œ


πŸ‘‘ AUTHORS πŸ‘‘

  • Denis Barbier <barbier@linuxfr.org>
  • Martin Quinson <martin.quinson@ens-lyon.fr>

and that's the whole page bestie 🌈 this was DEBCONF-GETTEXTIZE(1) from po-debconf, dated 2025-12-07. go forth and gettextize responsibly, mwah πŸ’–πŸŽ€πŸŒΈ

πŸ“¦ where this page comes from