best localization strategy?

Started by
3 comments, last by yuhaobo 17 years, 9 months ago

Hi, all I'm starting to explore on the localization techniques for my projects, so would like to know what is the common practice to do this in game programming. Currently, all my strings are stored in XMLs, but all the localization tools i researched upon deal with the project resources. Does this mean I'm doing something uncommon here? or anyboy aware of localization tools that can deal with xml?

Advertisement
Please tell us a bit more: what language/platform (C/C++/C#/Java/...) and are you using? For example: the .NET platform has an API and strategy known as satelite assemblies that defines versioning etc. for localization...

Cheers

hi, ernow,

Thanks for the reply.

I'm using unmanaged C++ with directx9, the IDE is .net2003. Too bad im not using any .net codes, (just pure C++ with STL), so i think the satelite thingy is not for me.

We localize all our games in multiple languages (Magic Lanterns went out in 10 different languages, including Chinese (simplified and traditional), Korean and Japanese). Here's what we did:

1. All text-strings are stored in a big excel file. One column per language. The first column is the identifier (a natural language string, in caps, with underscores.. so START_GAME, ENTER_HIGHSCORES, etc)

2. A VB macro saves out a unicode version of the excel file. One file per language, and each file contains a list of string pairs (so "START_GAME", "Start New Game", etc).

3. The runtime loads up the string file, and maps it to a std::map<unsigned int, string> table. the key is the CRC32 of the non-case-sensitive identifier. When we change languages we just reset that table, and refill it from another .lang file

4. At runtime, any time you set a text to a text-field, it'll check to see if the text-string is a valid identifier (map it to unsigned int, check to see if it exists in the string-table). If it is, it replaces the text with the text from the string-table.

There's a couple of small additions;
- You need to keep track of the key (or the identifier) for each text-field, so you can refresh all the text if you change language-file on the fly.
- CJK languages are uniformely sized, so you need to remember to left-align them if they line-break, or they'll look crap.
- Depending on your game, you might need a system for doing things like "Hello %s, welcome to %s".


Good luck,

Allan
------------------------------ BOOMZAPTry our latest game, Jewels of Cleopatra
hi, Allan,

Thanks for the detailed explanation, that confirms at least im not doing something odd.

For my part, i plan to write an application to setup a small database and output xml files. The different version of strings will be kept using the string identifier as key in database and tag in xml. My game would then read in the xml and put different strings to different structures.

This topic is closed to new replies.

Advertisement