Skip to content
Spencer Brown edited this page Nov 1, 2022 · 1 revision

BEEmod has localisation support for the application interface, as well as the contents of packages. Translations are stored using the GNU gettext format, and consist of three files:

  • POT files are generated from the BEE2 source code or package configuration, and are a template that can be copied to construct a new PO translation.
  • PO files are a text file containing the new translation.
  • MO files are a compressed form of the PO file, which is actually read by the BEE2 appication to translate text.

For translators

To save space, the POT and PO versions of translations are not included in the regular download. Clone or download the application/packages repo to get the original copies, then open an existing PO file or copy and rename the POT if this language has not started to be translated yet. The easiest way to edit these is with a dedicated program like PoEdit, but you can just use a regular text eitor. The file format consists of pairs of msgid and msgstr keys, where the msgid keys match text in the original configs/source code. These shouldn't be changed, instead a translated version put in msgstr.

The special symbol \n is used to indicate a newline. For application text, fields like {name} should be kept as is - these are subsituted with the appropriate text when displayed. They however can be reordered if the sentence works better that way. For the UI it is important to set "msgid" "__LanguageName" to the name of this language, so it can be displayed in the selection dropdown.

Once a translation is complete, it should be placed in the i18n (InternationalizatioN) folder, then compiled into a .mo file by clicking Build Package Translations button in the app options. The packages you wish to compile must be unzipped.

For package developers

To generate the POT template for your package, click Build Package Translations button in app options. This will scan the loaded package for translatable symbols, then generate a POT template. If PO files are also present, these will also be updated, adding entries for new text, and commenting out now unused translations for manual review and deletion. They will then be compiled into MO files for display. It is recommended that you use this button before releasing your package to the public.

Clone this wiki locally