The game server supports internationalisation ("i18n") using lean-i18n and i18next.
The intended workflow currently is the following:
- When you call
lake build
in your game, it should automatically create a template file.i18n/en/Game.pot
. Alternatively you can calllake exe i18n --template
to recreate it. - Open the file
Game.pot
(the "t" stands for "template") with Poedit (or a similar software) and translate all strings. Save your work as.i18n/{language}/Game.po
. - Call
lake exe i18n --export-json
to create all Json files.i18n/{language}/Game.json
which the server needs. - Add your translations (i.e.
.po
and.json
, but not the.mo
files) and push your results, and publish the game.
If you choose the correct language in the "Preferences" of the game, you should see your translations.
Note: This workflow is subject to change, and it might be that in future the server can directly read .po
files. Until then, there is also an alternative workflow you might choose:
- Add
useJson: true
to.i18n/config.json
lake build
orlake exe i18n --template
will now create a Json instead:.i18n/en/Game.json
.- Add translations to a copy of this Json an save it as
.i18n/{language}/Game.json
For games written in a language different than English, you should set the correct source language (sourceLang
) in .i18n/config.json
. Afterwards, on lake build
the template should appear under the chosen language, and can be translated (e.g. into English) as described above.
The server has a set number of languages one can select. If your game has been translated to a language not selectable, open an issue at lean4game requesting this new language. Or, even better, create a PR to translate the server interface into that new language.