buch415 edited this page Mar 6, 2013 · 4 revisions


Translations are currently supported for those languages with standard latin alphabet (that is: no cyrillic, no Chinese, etc.). Translation files are located under data/cfg/locale/.

The program checks system locale at startup and looks for the corresponding .cfg file inside the translation folder (for example, if the language is English, it'll look for data/cfg/locale/en.cfg). If that file's not found, the default locale will be loaded (English).

Localization files have this syntax:

language [language_code] {
    [string_id] = [string_text];

Take a look to one of the core translations to see which strings are supported; their identifiers should be quite self-explanatory.

NOTE: the language is automatically set from the system language; thus, your language code must follow the ISO 639 standard.

So, to add a new translation just create the corresponding .cfg file inside the data/cfg/locale/ folder and type in the necessary strings.

NOTE: if a string is not found it will be replaced by its identifier; for example, if you forget to include the title string, you'll see 'title' instead of 'PHYSICA' on the main menu.


Strings can also be put inside level pack and achievement files. Just add the same syntax inside the file and the string will be added to database when loading the pack or the achievement. Note that those strings are namespaced. In the example below (within a level pack file),

id = fancyPack;

//...other level pack information

language en {
    name = fancyPackName;

you have created a string whose identifier is This is to prevent conflicts between strings with the same identifier.

You can also add namespaced strings directly inside the language file. For example, inside the it.cfg file (for Italian translation) you can find something like:

language tutorial {
    name = Tutorial;

    msg1-1 = Guida il blocco verde a quello giallo;
    //...and other stuff

This way, when the tutorial gets loaded in Italian, it will recall the string for its name, which is defined inside the it.cfg file.


Some languages might require you to change the font due to charset (e.g. Russian or Chinese). To do so, you have to write a new themes file (the best way to do that is to copy the standard one) and then specify the path to that theme in the localization file. For example (on top of an ipothetical data/cfg/locale/lang.cfg file):

themesFile = data/cfg/locale/lang_themes.cfg;
//other language specification

The themes file just made must be modified to apply the requested font. That should be done pretty easily replacing the fontFile fields along the theme file with the path to the font you want to set.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.