Documentation section

File Format - PO/POT

Learn how to use Localazy CLI for app and software localization with translations in PO/POT files.

Gettext PO/POT format is fully supported including plurals and context information.

See the full specification for more details.

Context information ๐Ÿ”—

These comments are parsed and processed:

  • # - general comment
  • #. - extracted comment
  • #: - reference

Texts ๐Ÿ”—

The standard format for single and multi-line line strings is fully supported.

# Single line
msgctxt "Context"
msgid "Input text"
msgstr "Translation"

# Multiple lines
msgid ""
"The input text\n"
"splitted to several\n"
"lines"
msgstr "Translation\n"
"can also be splitted."

Plurals ๐Ÿ”—

Plurals are fully supported in the standard form described below.

msgid ""
msgstr ""
"..."
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"..."

msgid "Just one user online"
msgid_plural "There are %d users online"
msgstr[0] "Un seul utilisateur en ligne"
msgstr[1] "Il y a %d utilisateurs en ligne"

We generate Plural-Forms field in the header from the latest CLDR data, so the formula may be a bit different. However, it should be accurate and recent.

Use key for missing texts ๐Ÿ”—

Enable use_key_for_content in features in the upload section to use the msgid as a content where msgstr is empty.

POT format support ๐Ÿ”—

Use pot as the type or enable force_key_for_content for the po type in the upload section to use msgid as the content.

Working with empty translations ๐Ÿ”—

If you, for some reason, need to preserve empty translations, you will need two options that you can use in features in the upload section.

Feature Description
ignore_blank_content By default, empty translations in the input file are considered a valid empty translation. There are many reasons when using empty translation is a valid case. With this option enabled, empty translations are filtered out and the string is considered untranslated.
empty_untraslated This feature tells Localazy to output untranslated strings as empty translation.

Filtering untranslated strings ๐Ÿ”—

By default, when the output file is generated, Localazy uses texts from the source languages when the translation in the exported language is missing.

This approach is safeguarding you from missing keys that can lead to crashes in some solutions/frameworks.

This feature can be disable by adding filter_untranslated to features in the upload section and reuploading your source language file.