What is a POT File and how does it work for localization?
File Extensions | .pot |
API Extension | gettext_template |
Import | Yes |
Export | Yes |
Pluralization supported? | Yes |
Descriptions supported? | Yes |
Format Options | msgid_as_default |
POT, short for “portable object template”, is a format generated by GNU gettext to streamline the software localization and internationalization. While source strings are placed after “msgid”, their translations are placed after “msgtr”.
Note: POT files can sometimes be PO files as well. These two files are mostly identical except that PO files are generated by calling “msginit” in CMD. It is possible to perform the translation on a POT file first and then rename it to a PO. The final localized format should be a machine-readable “.mo” file generated from the PO file. The “.mo” file can be generated by calling “msgfmt” in CMD.
Format Options
Msgid as default
Identifier | msgid_as_default |
Type | boolean |
Upload | Yes |
Download | No |
Default | false |
Description | Use the key name (msgid) as translation |
Code Sample
msgid ""
msgstr ""
"Language: English\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: PhraseApp (phraseapp.com)\n"
msgid "boolean_key"
msgstr ""
msgid "empty_string_translation"
msgstr ""
#I'm a very important description for this key!
msgid "key_with_description"
msgstr ""
msgid "key_with_line-break"
msgstr ""
msgid "nested.deeply.key"
msgstr ""
msgid "nested.key"
msgstr ""
msgid "null_translation"
msgstr ""
msgid "pluralized_key"
msgid_plural ""
msgstr[0] ""
msgstr[1] ""
msgid "sample_collection"
msgstr ""
msgid "simple_key"
msgstr ""
#, fuzzy
msgid "unverified_key"
msgstr ""
More information