GNU Gettext is a widely used i18n system. For a majority of programming languages and frameworks you will find a Gettext implementation. Most commonly it is used for internationalizing PHP, Python, C, C# etc.
Gettext offers different resource file formats to externalize your segments. The most common human/machine readable file format is Portable Object (.po). LingoHub supports this file type.
The import POT (Portable Object Templates) files is supported as well. Every imported POT file will be handled as source language update. This means the “msgid” attributes will be used as translation title and as value of the source language text of the segment.
- The value of the PO attribute “msgid” will be used as translation title.
- The value of “msgstr” will be used as the text for the segment.
- If “msgctxt” is given, it will be used as part of the translation title. Eg.: “<msgctxt>/<msgid>”
- As mentioned in our Resource Files documentation, the title that is created using msgctxt + msgid has to be unique in every file.
- Examples for placeholders are: “%s”, “%10s”, “%d”, “%3.4d”
- LingoHub is able to handle plurals defined using “msgid_plural”
- One can specify a header for a PO file containing metadata. You do not need to specify a header to work with LingoHub. We ensure that the header will be exported as it was imported.
- In the PO file header you can specify a charset: “Content-Type: text/plain; charset=UTF-8\n”. Please make sure that this indication is correct. On the other hand LingoHub will try to fix wrong charset declarations.
- A comment line starts with “#”. LingoHub will parse these comments and will assign it as description to the next segment.
- LingoHub will not try to interpret any special comments like references or flags, but will leave the values unaltered.
- The comment placed before the header will be imported and exported untouched.
Additional example files can be accessed here.