Implementing translation support
Posted: 31 Mar 2012, 06:44
Hello all,
It's time to tackle the task of adding translation support to meandmyshadow.
There are three parts that need translation support.
Game
The first one is the most obvious one, the game itself.
We need to make everything translatable, from the console output to the window title.
I think the easiest solution for this is to use GNU gettext.
My only concern is that non-latin characters won't show probably with the fonts we use.
Levelpacks
With levelpacks a translation folder can be added in which translations files can be placed.
The translation files should contain the text from all the levels inside the pack but also the description (and name?).
The actual translating could still be done by gettext (or tinygettext, which STK uses).
Levels
I think this one is the hardest to do, but also the least important one.
The best way to do it is to threat it just like levelpack translations, but that would mean that a single level can now exist out of more than one file.
Adding the translations to the level file isn't such a good idea either, the md5sum would changes just because a translation is added/updated.
Another possible solution would be to do the game translation using (tiny)gettext and the level(pack)s using a custom system.
Still adding the translations to the level files but calculate the md5sum without it.
Any suggestions?
It's time to tackle the task of adding translation support to meandmyshadow.
There are three parts that need translation support.
Game
The first one is the most obvious one, the game itself.
We need to make everything translatable, from the console output to the window title.
I think the easiest solution for this is to use GNU gettext.
My only concern is that non-latin characters won't show probably with the fonts we use.
Levelpacks
With levelpacks a translation folder can be added in which translations files can be placed.
The translation files should contain the text from all the levels inside the pack but also the description (and name?).
The actual translating could still be done by gettext (or tinygettext, which STK uses).
Levels
I think this one is the hardest to do, but also the least important one.
The best way to do it is to threat it just like levelpack translations, but that would mean that a single level can now exist out of more than one file.
Adding the translations to the level file isn't such a good idea either, the md5sum would changes just because a translation is added/updated.
Another possible solution would be to do the game translation using (tiny)gettext and the level(pack)s using a custom system.
Still adding the translations to the level files but calculate the md5sum without it.
Any suggestions?