File Import settings

PO Files

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

The PO file filter by default imports files with the following extension:

  • .po

File Import Settings

  • Export multi-line strings (This option is selected by default and improves the handling of PO files with \n tags.)
  • Convert to Memsource tags (This uses regular expressions for converting specific text to tags—see our Regexp manual for more information.)
  • Use HTML subfilter (See HTML File for available customization.)
  • Segment PO (These segmentation rules will be used to segment the text in the source and target elements).

File Format

The valid PO gettext file is bilingual, where 'msgid' contains source text and 'msgstr' contains target text. You can find more details in this PO user guide.

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

Plural Form

PO Gettext allows the localization of Plural Forms* which are supported in Memsource.

  • 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 will be 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 should be imported with the Segment Key Context to get better leverage from the translation memory.
  • 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—will be added to the segment's Context Key and saved to the TM. It will also be displayed in the Editor's Context Note window.

 * PO GNU Gettext only supports plural forms with integer numbers. A decimal number form such as "1.5 points" is not supported by PO files and therefore cannot be offered by Memsource.

1. Example of an unspecified plural in PO Gettext file.
If this file is imported to German and Arabic, the German target file will have only 2 plural forms while the Arabic target file will have 6 plural forms. 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"

#:ui/gui/409
msgctxt "GUI|Installation"
msgid "%d _storage device selected"
msgid_plural "%d _storage devices selected" 

2. Example of file with the 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"
#:ui/gui/409 msgctxt "GUI|Installation" msgid "%d _storage device selected" msgid_plural "%d _storage devices selected"
msgstr[0] ""
msgstr[1] ""
msgstr[2] ""