=head1 NAME po-debconf - introduction =head1 DESCRIPTION The goal of C was to make package configuration user-friendly. In order to achieve this, it is important to ensure that users will get the question in their own language. Translators need a framework to easily work on translations without having to track package development; C was designed to be able to work with standard C tools when translating debconf templates files. =head1 ADDING I18N SUPPORT TO DEBCONF TEMPLATES FILES If you are adding debconf support to your package, you have written a templates file containing English text. To add proper i18n support into your package, you need to: =over 4 =item - Create F This file contains the list of master templates. It typically contains a single line: [type: gettext/rfc822deb] templates Paths are relative to the parent directory. =item - Prepend an underscore before translatable fields in each template Normally C, C and sometimes C fields can be translated. =item - Run B This will create the F file that translators will translate into their language. =item - Add a build dependency on C in F =back =head1 UPDATE TEMPLATES In order to help translators, PO files in your package should always be up-to-date, otherwise they may waste their time translating unused strings. For that, simply call the following command without arguments: $ debconf-updatepo You should run this command every time you change templates in English, but also when you receive new or updated translations, because translators may have worked on an obsolete PO file. If you rename, add or remove some templates files, remember also to edit F accordingly, otherwise English strings are missing from PO files and will be displayed to users even if PO files are fully translated. The B program is idempotent, it modifies PO files only if their content has been updated. Thus the best way to provide up-to-date PO files in your source package is to call this command from the C target of the F file. Please note that you need to run B even if you use B. The latter calls B which used to call B if outdated files were detected, but this is no more the case because it was not a good solution for at least two reasons: =over 3 =item 1. B relied on timestamps to detect outdated files, and may be abused when using C or if an outdated translation has been stored on disk after templates have been modified =item 2. B is called long after C<.diff.gz> file has been generated =back =head1 MERGE TRANSLATIONS AND ORIGINAL You have to make sure that when your package is compiled, translations will get into the built package. You can do that manually, or automatically using the B script (make sure to have a versioned build dependency against C= 4.1.16)>). To do that manually, you'll have to merge the templates and the translations at compile time (and to have a build depend against C) like this: $ po2debconf debian/templates > debian/tmp/DEBIAN/templates B: the two files called F are not the same at all. The first one contains only the English text, with marks to denote some fields to be translated while the second contains all languages. That is to say that you CANNOT keep only the merged templates, or you won't be able to deal with translations as people submit them to you. =head1 NEW MASTER TEMPLATES The new templates file source format is almost identical to one of distributed templates files, but translatable fields are prepended with an underscore. Example: Template: debconf/frontend Type: select _Choices: Dialog, Readline, Gnome, Editor, Noninteractive Default: Dialog _Description: Interface to use for configuring packages: Packages that use debconf for configuration share a common look and feel. You can select the type of user interface they use. . The dialog frontend is a full-screen, character based interface, while the readline frontend uses a more traditional plain text interface, and the gnome frontend is a modern X interface. The editor frontend lets you configure things using your favorite text editor. The noninteractive frontend never asks you any questions. =head2 SPLITTING CHOICES LIST Since C 0.6.0, localized fields may contain two leading underscores. In this case, the field value is supposed to be a comma separated list of values, which are put in separate msgids. Thus if the previous example did contain __Choices: Dialog, Readline, Gnome, Editor, Noninteractive there would be 5 different msgids. Note that spaces after commas are not significant. When a choices list never changes, C<_Choices> may be considered fine. However, splitting such lists may help avoiding frequent mistakes in translations such as omitting a choice or using non-standard commas. For such reasons, the use of C<__Choices> will ease translator's life and is strongly recommended. Unfortunately if you decide to switch from C<_Choices> to C<__Choices>, all translations become fuzzy. Here is an explanation to make this change without translation loss (it requires C E= 1.0). Suppose that we want to switch the previous example to C<__Choices>. You copy the F file into a temporary file. $ cp debian/templates debian/foo Edit F and keep only C