PO2DEBCONF(1)

πŸ’– PO2DEBCONF(1) β€” po-debconf πŸ’–

okay bestie, gather round, because this is the glow-up your translation workflow has been waiting for 🫢 this one lives in the po-debconf family and honestly? iconic.


✨ NAME ✨

po2debconf β€” merge master templates file and PO files πŸ’…


🌸 SYNOPSIS 🌸

po2debconf [-v] [-h] [--podir=DIR] [-o FILE] [-e STRING] master

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, this program reads all your PO files plus a single templates file, and it produces a Debconf templates file that's got all the translations baked in β€” basically the same energy as the one debconf-mergetemplate(1) spits out (that's the one from the "debconf-utils" package, iykyk). and where does it go looking for PO files? by default it searches in the po subdirectory below the location of the master file. cute, right?

now, for the Norwegian BokmΓ₯l language code transition, the no and nb language codes get special treatment 🧚 if no.po exists, it should be renamed to nb.po. using nb.po will make both "-no" and "-nb" translations available in the templates file. slay.

lines beginning with a number sign ("#") are comments in templates files. they're super useful for giving hints to translators, and po2debconf just discards them, no cap. but!! special comments have been introduced in "po-debconf" 1.0. they look like "#flag:directive". and the "#flag:partial" is the only directive that po2debconf actually interprets. here's the tea: normally when a field is composed of several paragraphs (like "__Choices" and "_Description"), it gets translated only if all paragraphs are translated. but when a field contains "#flag:partial", translated strings may be mixed with untranslated strings. periodt πŸ’…


πŸ’œ OPTIONS πŸ’œ

  • -h, --help β€” display a usage summary and exit. bye bestie πŸ‘‹
  • -v, --verbose β€” process in verbose mode. she's chatty and we love that ✨
  • --podir=DIR β€” set directory for PO files. default is to search PO files in the po subdirectory below the location of the master file.
  • -o, --output=FILE β€” set output filename (default is standard output).
  • -e, --encoding=STRING β€” convert encoding. the argument can take 3 values:
    • "utf8" β€” convert to UTF-8 🌈
    • "po" β€” do not change encoding
    • "popular" β€” convert encoding of input files depending on their language. the "PODEBCONF_ENCODINGS" environment variable must point to a name of a file containing the encoding map.

such a filename looks like:

#
#   Number is comment sign
#
cs       ISO-8859-2
da       ISO-8859-1
de       ISO-8859-1
el       ISO-8859-7

etc.

fun lore moment: the default encoding used to be "popular", and it has been switched to "utf8" since po-debconf 0.9.0. glow-up fr fr πŸ’…

πŸ‘‘ OUTPUT FORMAT πŸ‘‘

since debconf 1.2.0, the templates format has changed β€” encoding is part of field names now, i.e. they're "foo-lang.encoding". and when older debconf encounters such fields? they are silently ignored, which means the original text gets displayed. πŸ’€

if present, a po/output file can override defaults for encoding and output format. it contains a single line with two fields. the first field is the output format (currently valid values are 1 for fields in the form "foo-lang", and 2 for "foo-lang.encoding") and the second field is the encoding, e.g.

echo '2 utf8' > po/output

let po2debconf convert text to UTF-8. no cap πŸŽ€

when encoding is set to "po" or "utf8", output format is always set to 2, so that older debconf do not try to display text with wrong encodings. protecting the elders, honestly πŸ’–


🌈 SEE ALSO 🌈


πŸ“ AUTHOR πŸ“

Denis Barbier <barbier@linuxfr.org> β€” legend behavior, honestly πŸ‘‘


and that's the whole vibe, bestie β€” this page came straight out of po-debconf, dated 2025-12-07, and it's giving main character energy from start to finish. go translate something gorgeous πŸ’…βœ¨

πŸ“¦ where this page comes from