PO (portable object) file format is popularized by GNU gettext software and is natively supported by various developer tools including Unreal Engine and eclypse. This article defines how eclypse interfaces with the PO files.
Sample PO File
msgid "" msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: eclypse\n" "Language: en-GB\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "MIME-Version: 1.0\n" #. developer-comments msgid "order_summary" msgstr "Order summary" # translator-comments msgid "number_of_messages" msgid_plural "number_of_messages" msgstr[0] "one message" msgstr[1] "%d messages" msgctxt "asked when user selects a vehicle" msgid "select_country" msgstr "Select country of residence"
Metadata
The first entry in a PO file may be reserved for metadata as shown in the sample PO file. Metadata entry has empty msgid field.
Schema
eclypse largely follows the schema of a PO file as described in GNU PO file specifications. However,
Field in PO | Field in eclypse | Discussion |
---|---|---|
msgid | key | |
msgstr | phrase for the specified language | |
msgstr[n] | plural phrase for the specified language | |
msgctxt | additional context. Mapped to custom attributes. | This field has no effect on eclypse. eclypse saves this reference and includes it back in the export for the benefit of the source system. |
# ... | translator's comments. Mapped to description. | If this key exists in eclypse and there is already a description, this field overrides it. |
#. ... | developer's comments. Mapped to description. | If this key exists in eclypse and there is already a description, this field overrides it. |
#: ... | code comments. Mapped to custom attributes. | This field has no effect on eclypse. eclypse saves this reference and includes it back in the export for the benefit of the source system. |
#, ... | comments / flags. Mapped to custom attributes. | This field has no effect on eclypse. eclypse saves this reference and includes it back in the export for the benefit of the source system. |
#| ... | comments / previous translation value. Mapped to custom attributes. | This field has no effect on eclypse. eclypse saves this reference and includes it back in the export for the benefit of the source system. |
Unreal Engine Collapse Mode
If this PO file was created by Unreal Engine, you will have to specify the collapse mode before importing this file into eclypse. Correctly selecting the collapse mode ensures that when you ingest the translated files back to Unreal Engine all your keys work as you expect them. Here is how the eclypse interface looks like during PO file import process:
See also
Unreal Engine Text Collapse Mode