Next: , Previous: , Up: Top   [Contents][Index]


5 Language Tables.

To recreate the canonical PO name (see canonical-name) for a given translation, wyslij-po needs to know the language code associated with this language. Normally this information is kept in the Language header of the PO file2. If this header is not present, wyslij-po will first obtain the full language name from the Language-Team PO header, and then use this value as a look-up key in a set of language tables. If the key is found, its value gives the language code.

This language code lookup is retained as a fallback mechanism for handling old PO files and will be removed in future releases. This chapter describes the format of language table files used by wyslij-po.

The language tables are stored in plain text files. Their format is as follows:

For example, the following entry:

pt_BR Brazilian Portuguese

means that when the string ‘Brazilian Portuguese’ is encountered at the beginning of the Language-Team PO header, the language code ‘pt_BR’ will be used.

There are two language table files: a system-wide and a per-user one.

The system-wide language table is stored in file wyslij-po.lc in your system configuration directory (by default it is /usr/local/etc, but can be changed at compile time).

The per-user language table is read after the system-wide one. It is located in the user’s home directory and is named .wyslij-po.lc. You can also supply another file name, using the --langtab command line option, e.g. --langtab=mytab.lc.

The contents of both files are concatenated and stored in a single table.

Notice that it is not an error if a language table file does not exist. Wyslij-po will silently ignore non-existing files. Therefore, if you get the similar error:

wyslij-po: Unknown language: Bulgarian

you should make sure the right tables are read, by running wyslij-po with the -vv (or, better yet, --dry-run --verbose) command line option. In normal case, it will at least read the site-wide language table, which will be reflected in its output:

$ wyslij-po --dry-run -v bg.po
Sourcing language table `/usr/local/etc/wyslij-po.lc'
Restoring canonical file name for `bg.po'

If it does not, make sure you install the table or supply its alternate name using --langtab. Otherwise, inspect the table and add an entry for the language in question.

The package is shipped with a system wide configuration file built using the data from http://translationproject.org/team, so most of the time you won’t have to edit it (unless, of course, new language teams are added to the TP)


Footnotes

(2)

The Language header is present in PO files created by gettext version 0.18 or later.


Next: , Previous: , Up: Top   [Contents][Index]