File Import Settings

.PO - gettext (TMS)

Content is machine translated from English by Phrase Language AI.

PO gettext is an internationalization and localization (i18n) system commonly used for writing multilingual programs on Unix-like computer operating systems.

Only the context-key is considered by the QA check when identifying the same source.

Valid .PO files are bilingual, where msgid contains source text and msgstr contains target text.


#: src/name.c:36
msgid "My name is %s.\n"
msgstr "Je m'appelle %s.\n"

File Types

  • .PO

Supported Placeholder Formats

  • c-format

  • objc-format

  • sh-format

  • python-format

  • python-brace-format

  • elisp-format

  • librep-format

  • scheme-format

  • smalltalk-format

  • java-format

  • csharp-format

  • awk-format,

  • object-pascal-format

  • ycp-format

  • tcl-format

  • perl-format

  • perl-brace-format

  • php-format,

  • gcc-internal-format

  • gfc-internal-format

  • qt-format

  • qt-plural-format

  • kde-format

  • boost-format

  • lua-format

  • javascript-format

Import Options

  • Parse ICU messages

    ICU messages are automatically converted to tags. Files with ICU messages cannot contain any inline elements.

  • Export multi-line strings

    Selected by default and improves the handling of .PO files with \n tags by adding actual line breaks in the exported .PO file.

  • Convert to Phrase TMS tags 

    Apply regular expressions to convert specified text to tags.

  • Segment PO

    Segmentation rules will be used to segment the text in the source and target elements.

  • Use HTML subfilter 

    Imports HTML tags contained in the file. Tags can then be used with .HTML file import settings.

  • Set context key to

    Select additional context key information that will be appended to msgstr and saved as context to TM.

  • Translatable inline elements - Non-translatable inline elements

    Subfilter fields for specifying which elements will be converted to tags and treated as translatable or non-translatable.

  • Import Segment Rules

    Set confirmation based on fuzzy or non-fuzzy.

  • Export Attributes Mapping

    Set export attributes based on fuzzy or non-fuzzy status.

Plural Form

PO Gettext allows the localization of plural forms.

PO GNU Gettext only supports plural forms with integer numbers. Decimal number form such as 1.5 points is not supported.

  • The original file has to contain msgid_plural string as well as the singular msgid.

  • The plural rules specification (the formula) defined in the file's header is used to generate plural forms. If there is no such specification, the standard Unicode CLDR plural rules based on the target languages will be used for the job import.

  • The file must be imported with the Segment Key Context in order to use the plurals functionality properly.

  • The target locale and the plural form of the segment will be used as the segment's context key and saved to the TM,

  • The string msgctxt, if present in the original file, is added to the segment's context key and saved to the TM. It is also be displayed in the context note window. In case msgctxt is empty, only msgstr keyword is used and saved.

Example 1. Unspecified plural in PO Gettext file

If imported to German and Arabic, the German target file will have only two plural forms while the Arabic target file will have six. The correct plural rule will be automatically used for each target language, and the job will be imported with a language-specific number of plural forms.

msgid ""
msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

msgctxt "GUI|Installation"
msgid "%d _storage device selected"
msgid_plural "%d _storage devices selected" 

Example 2. Specified plural rule for the Czech language in the header

This file will always have 3 plural forms even when imported to German or Arabic.

msgid ""
msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n>=2 && n<=4 ? 1 : 2);\n""Language: cs\n"
msgctxt "GUI|Installation"
msgid "%d _storage device selected"
msgid_plural "%d _storage devices selected" msgstr[0] ""msgstr[1] ""msgstr[2] "" 

Was this article helpful?

Sorry about that! In what way was it not helpful?

The article didn’t address my problem.
I couldn’t understand the article.
The feature doesn’t do what I need.
Other reason.

Note that feedback is provided anonymously so we aren't able to reply to questions.
If you'd like to ask a question, submit a request to our Support team.
Thank you for your feedback.