From PioneerWiki
Jump to: navigation, search

All text in Pioneer is translatable, and the game ships with several translations. Here's everything you need to know.

For translators

All our translations are managed through Transifex, a free web-based translation service. To start writing translations, sign up there, using this link, and then take a look at the Pioneer project. You can either use the web-interface, or download the full file, and edit off line, and then re-upload.

Changes to translations are automatically pulled into the master git repo, from transifex, twice per day, and from there to the builds when they're next run.

In Transifex you can subscribe to notifications for the languages or resources you're interested in. When new strings are added or modified, you'll be notified.

If you want to translate Pioneer to an entirely new language, please open an issue on the tracker and someone will create the translation for you.

English is the canonical language for Pioneer. As such, you can't directly modify the english strings through Transifex. If you want to change those, you'll need to make the change in source code hosted in git and submit a pull request like for a normal code change. However, do note that changes in english text will trigger re-translation of that string in all other languages, thus there should be a good motivation why a string is changes (e.g. spelling/grammar).

Untranslated strings will use the value from the English version.

You can leave comments in Transifex to help out other translators. You'll also see any notes left by the developers to help you translate a particular string.

If you're a new translator and you'd like your name included in AUTHORS.txt, please let us know!

For when you translate: Text within curly brace denote a varialbe name that will be substituted and should not be translated, e.g.

   "Welcome to {system}"

For mod developers

Each module gets its own translation resource, called module-foo.

To get at the strings for your module, do something like:

   local Lang = import("Lang")
   local l = Lang.GetResource("module-foo")

Then you can get at the string by its token:


While its possible to load multiple translation resources to share strings, its highly recommended that you don't do that. Stick to your own strings so that you don't have to track changes in other modules. Duplicates across resources are fine. Note that code that uses multiple resources won't be accepted into the main Pioneer repository unless you've checked it with a core developer first and it has a good reason.

Translations are chrome.i18n JSON files. The format is fairly simple - a JSON object with tokens as keys and values of an object with two keys, message and description. message is the text that will appear in the game, while description provides instructions for the translator that will be displayed in Transifex. Here is a useful chart showing how characters are interpreted.

If you're submitting code that requires a new language you should only include en.json. Please tag @impaktor in your pull request so they can create a new resource in Transifex and make sure a language update is done at merge. If you don't do this then you'll break the game for non-English users.

For core developers

The core resource is magical. If you add a string to it, you also need to add it to and recompile. It will then be available as Lang::SOME_TRANSLATED_STRING.