GNU PO Format

From Lime 49 Wiki
Jump to: navigation, search


Bundle and File Names

Resources can be imported from GNU gettext formatted PO files either individually or as a zip archive. The names of the PO files inside the zip are used to determine the bundle names and languages of the resources they contain. If uploading individually, a random bundle name will be generated. To upload to a specific bundle, create a folder for that bundle inside the archive.

For example: In an archive structured as follows, a bundle would be created (if one didn't exist) called generalStrings, then translations for resources in German, French and English would be imported.





If a single file is imported, the untranslated strings it contains are used to add entries for the default language of the application into which the file is imported.

File Format

Resources inside each PO file are parsed according to GNU's PO file format.

PO files sometimes include an empty entry at the start of the file containing metadata. This entry is given the name Generator when importing, and is exported with no msgid when outputting to PO format. It is also possible to manually create this entry.

Each entry is structured as follows:

# translator comments

#. source code comments

#: ../../source/someapplication/locales/../src/interface/statuslinectrl.cpp:34

#: ../../source/someapplication/locales/../src/interface/statuslinectrl.cpp:97

msgctx "context info"

msgid "Untranslated String"

msgstr "Translated String"

Plural Translations

ResourceBlender does not support plural forms, so translations in the form msgstr[N] are split into new elements.

For example: When the following entry is parsed, an element will be created for 1 week and 1 woche, then another will be created for %d weeks and %d wochen.

#: includes/
msgid "1 week"
msgid_plural "%d weeks"
msgstr[0] "1 woche"
msgstr[1] "%d wochen"

PO File Editor

Click the GNU icon when editing an element to open the PO file editor. This allows entry data to be edited. Source comments, references and flags should be separated by a new line. The message context will be omitted if the Context field is left blank. To add an empty context, use an empty pair of quotes ("").

Comments, references and flags do not need to be prefixed by #,#. or #,, these will be added automatically.

JavaScript PO Editor in ResourceBlender.NET
PO Editor in ResourceBlender Express

Note: Only the source code comments, references and flags can be edited using the PO editor. Translators' comments are displayed in the Translator's Comment field.

Back to ResourceBlender Help Contents

Personal tools