Localization in MyGUI

oiking

06-08-2008 15:50:02

I know some other GUI systems where you can let replace strings in the GUI definitions with other strings on load-time.
It's realized by giving the GUI system a callback with a "translate" method that takes a string and returns another. This makes Localization of projects really easy as you can just write placeholders like [START] or [MAKE_MY_DAY] or [DESCRIPTION_GAMEPLAY] into your GUI files and let the callback check for [xxx] and replace the string accordingly with the correct language string.

I had a quick look into the mygui source to find the best place to implement such a system, but I couldn't find a good interface where I can intercept assignments from the GUI files easily. Can you give me a hint where I could start? When it's done, I'll provide you with the actualized files or patches.

If I am totally wrong and mygui already has this feature, please forgive me and point me the right way :)

Altren

07-08-2008 15:51:31

Actually there's not many code to implement, main problem is to choose good tag and file format for localization.
We selected #{text} for tags. Still thinking about file format for localization.

Altren

08-08-2008 10:28:34

Done. You can update from svn and try it. See LanguageManager. There's small example in TestApp. Same tags can be used in layout file.

P.S. This is just prototype, so function names may change a bit later. You are also welcome with suggestions.

oiking

09-08-2008 14:49:21

Cool! I'll try this right when I'm back at the office.
Support is <wow> :-)

oiking

28-08-2008 14:08:03

I've updated our version of MyGUI to the current SVN Revision, here are some thoughts about it:
The Localization doesn't really fit into our localization solution. MyGUI now apparently uses it's own files for localization, what's bad if you get all your localization for dynamic strings i.e. from a database.

I would step in and fix/rewrite some things on my own but documentation is bad and neither are cyrillic characters displayed in my IDE nor can I read or understand russian. There is much to be improved, but MyGUI really is a great GUI, simple to use if you once got behind it and easy to integrate into every Ogre Application. I really don't want to miss it, even Skin creation is faster than with CeGUI ;-)