Gettext PO File

The GNU gettext toolset helps programmers and translators at producing, updating and using translation files, mainly through PO files which are textual, editable files.

Gettext PO files are used by GNU gettext.

This format behaves a little different than most other formats in order to make it compatible with Applanga.

  1. Id's

    When importing an Po file Id's will be automatically generated. This follows the following Pattern contextName$@MsgidHash[pluralisationType]

    Note:

    1.1 pluralistaionType is only given for plural messages.

    1.2 $@ is the delimiter for the id's do not use this delimiter lightly in your msgid

    1.3 If you change the Source message in your application and import the po file again, you will end up with a legacy id since the Hash has changed. So you should try to avoid this.

  2. Pluralisation

    All pluralisation types that Applanga supports are supported with the Gettext Po export, but they might not be contained in your export file, since Po files have a special pluralisation styles for many languages

    Example:

    For arabic (ar) export, all pluralisations would be present in the exported file [zero,one,two,few,many,other].

    For japanese (ja) export, only one pluralisation type would be present [other].

    Gettext Po uses 17 of those pluralisation styles. They are conform with those from Qt TS files, most of them are documented here.

  3. Meta attributes

    After you imported a Po file, your Project will have meta attributes called ApplangaIDContext and ApplangaIDSource and ApplangaIDPluralSource.

    All those attributes should not be edited manually

  4. Additional metadata

    Metadata fields for attributes present in the Po file will also be created:

    • ApplangaPOExtractedComments containing comments given by the programmer, directed at the translator
    • ApplangaPOReference containing references to the program’s source code.
    • ApplangaPOFlags containg list of keywords that inform further tool processing

You can either import and export your .po files manually on the dashboard or you can automate your po file translation process with the Applanga Localization CLI.

Website: https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html

File Extension
.po
CLI format key
gettext_po
CLI Supported
true
SDK Supported
false
String Description Supported
true
Pluralization Supported
true

Example:

msgid ""
msgstr ""
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Applanga (applanga.com)\n"

msgid "empty_string_key"
msgstr ""

# Here is the description of the key
msgid "with_description_key"
msgstr "This key has a description in some file-formats."

msgid "with_line_break_key"
msgstr ""
"This key has a line break\n"
"in it."

msgid "nested_key.level_one_a.level_two"
msgstr "A deeply nested key."

msgid "nested_key.level_one_b"
msgstr "A nested key."

msgid "array_key[0]"
msgstr "first entry"

msgid "array_key[1]"
msgstr "second entry"

msgid "array_key[2]"
msgstr "third entry"

msgid "simple_key"
msgstr "Most basic translation."

msgid "plural_key"
msgid_plural ""
msgstr[0] "Plural key one"
msgstr[1] "Plural key other"