Under my post about Tweakingu different things appeared a great comment FrozenShare (co-creators of SkullStone, whose trailer I recently posted).
Here's the comment:
Weapon parameters, location… I think I'm going to have something interesting to say here. I'll use the example of my game Skullstone.
Weapons in the game has several parameters: some basic damage, type, distance (in the fields of play) on which to fly, when it is thrown, and several other parameters related to the mechanics. All of this is kept in an XML file.
Such weapons (as well as other objects) must also have a handful of other information, such as the icon-its name and path (relative to the game's resources) can be successfully kept in the said file. Well, what about the name? The name of course also…. And here comes the problem of multilanguage-how to stick?
You can give each text in the game an identifier and all the texts for that language stick in separate files. I use this solution… In simple window programs, where the only texts are the messages and subtitles on the buttons and the panes-because in the games of this text is usually more. We need to translate not only the names of items but the subtitles on the GUI, dialogues, some hints….
What if I would consider text as an object?
Going back to the aforementioned item in the XML file, instead of writing <name> item name </name> You can write <name> <pl> the name of the item </pl> <en> item name </en> </name> and the tag ' name ' should be treated as a class object constructor eg. MultilangString. Now just 'jakoś figure ' (in different languages is done differently) so that objects of this new class can be added to String objects (simple text concatenation) and that during this operation was checked the current language (kept in a global Statiku ) and we have Multilang made practically painlessly from the code and easy to edit from the file level.
Texts in all files (dialogues, quests, item descriptions) would contain the appropriate tags <pl>, <en> and possibly others, when adding support for new language simply add a new tag, eg <fr> and content, edit at once only one file. Of course, the new language must also add in the code… Well, unless gone to create a file with a list of languages, where for each language we have its name and… 😉 Marker