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/*.pofiles for each language containing translated strings. π - Each input file receives an
.oldsuffix, 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.infile is also created, and it contains the list of templates filesdebconf-updatepohas 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:
po2debconfis run on this template file to generate a translated templates file. π§- This translated templates file is processed as described above, and PO files are generated.
- Newly created PO files are merged with existing ones. slay.
When PO files are merged,_Choicesfields have to be replaced by__Choices(or vice-versa) in the original templates file before runningdebconf-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 theposubdirectory below the location of the first master file. π--choicesβ by default,debconf-gettextizereplacesChoicesfields with_Choices. With this flag though,__Choicesfields 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 andpo/POTFILES.inare 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
- ubuntu resolute: po-debconf 1.0.22 Β· GPL-2.0-only OR GPL-2.0-or-later
- ubuntu stonking: po-debconf 1.0.22 Β· GPL-2.0-only OR GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms