Friday, September 28, 2007

Text and messages translation in WWJ

In the WWJ SDK you may have noticed a file named MessageStrings.properties and several others named the same but with an extra two characters country code like de, ja,or zh. These are simple text files that contain all the constant character strings for one language. WWJ will use the one that has the same country code as your computer settings.


To have WWJ 'speak' your tongue, just make a copy of the default english file - the only one that contains all the messages, and name it MessageStrings_xx.properties, xx being your country code. Then translate the messages you want and delete all the others. You dont need to have all the messages translated in your file, the missing ones will fall back to english.

Note that special characters must be specified as Unicode hexadecimal numbers (eg. \u00c9 for 'É').

Here is a portion of a french property file with translated layer names. Get MessageStrings_fr.properties, and after removing the .txt extension, place it with the other MessageStrings files. Run one of the demo or example applications.

Also note that this doesnt translate the placenames...

No comments: