I added messages.cfg into locale/en/ folder.
But when I call game.gettext('msgname') it returns 'MISSING TRANSLATION'.
messages.cfg contains no bracketed sections. Just a bunch of key=value messages.
Names of items and technology with description are localised fine.
What I'm missing?
localisation and gettext
-
- Filter Inserter
- Posts: 402
- Joined: Fri May 23, 2014 8:54 am
- Contact:
Re: localisation and gettext
There are two locations for locale files. "__mod__/locale/en/en.cfg" is for translation of prototypes. "__mod__/script-locale/en.cfg" is for use with game.gettext().
Relevant section form the wiki:
Relevant section form the wiki:
Wiki wrote:The game will automatically load locales from mod directories (i.e. mods/foo-mod/locale). The locale directory must be in the same format as the regular locale directory (having two letter directories for different languages and then .cfg files inside). The locales are merged into the original ones. The locale for a mod control.lua script can be placed in the script-locale directory (there the format is having a .cfg file for every language).
Re: localisation and gettext
Uh. Thanks. Info on wiki could be a little more verbose. At evening I totally failed to understand what's written 
