debconf-gettextize

NAME

debconf-gettextize - extract translations of debconf templates into PO files

SYNOPSIS

debconf-gettextize [-v] [-h] [--podir=BI\s-1DIR\s0] [--choices] [--merge] master [master ...]

DESCRIPTION

The /var/lib/dpkg/info/*.templates files read by debconf contain English text and translations in the same file. But in source packages, translations are managed in separate files to help translators. In the initial implementation, a master templates file contained only English text, and templates.xx files contained both original and translated strings for the language xx. The debconf-mergetemplate program was merging master and translated templates files.
The new implementation with CWpo-debconf is based on CWgettext. Maintainers mark translatable fields by prepending them with an underscore, English strings are automatically extracted into a \s-1POT\s0 file, translators work on normal \s-1PO\s0 files, and po2debconf generates a merged templates file with the same structure.
The debconf-gettextize program was initially designed to help migrating to the new implementation.
"" 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 is renamed with a CW.old suffix, and new master file overwrites the old one; it is identical to the master file except that an underscore is prepended to translatable fields. Developers can then choose which fields translators have to work on and which ones are skipped because their values are not locale-dependent.
"" A po/POTFILES.in file is also created, it contains the list of templates files debconf-updatepo has to process.
Typically the debconf-gettextize program must be run only once when transforming from the first implementation to the CWpo-debconf format, but it can also be used afterwards to transform a CW_Choices field into CW__Choices (or vice-versa) without losing translations, when using the CW--merge flag (alongside with CW--choices or not). The desired template containing the CW_Choices or CW__Choices fields to modify has to be copied into a temporary template file, which is passed as an argument of debconf-gettextize. The following steps are then performed:
"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 \s-1PO\s0 files are generated.
"3." Newly created \s-1PO\s0 files are merged with existing ones.
When \s-1PO\s0 files are merged, CW_Choices fields have to be replaced by CW__Choices (or vice-versa) in the original templates file before running debconf-updatepo, otherwise new translations will be fuzzy.

OPTIONS

"-h, Display a usage summary program and exit.
"-v, Process in verbose mode.
"--podir=BI\s-1DIR\s0" Set directory for \s-1PO\s0 files. Default is to search \s-1PO\s0 files in the po subdirectory below the location of the first master file.
"--choices" By default, debconf-gettextize replaces CWChoices fields by CW_Choices. With this flag, CW__Choices fields are written instead.
"--merge" This flag is set, the first master file is \s-1PO\s0 files are generated, but templates files and po/POTFILES.in are not modified.

CAVEATS

The CWDefault field is special when template type is CWSelect or CWMultiselect, because value has to be chosen amongst 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). In order to let translators know that this localized CWDefault field is special, you must by convention call it CW_DefaultChoice instead of CW_Default.

SEE ALSO

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

AUTHORS

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