Fredag 09 mars 2007 14:31 skreiv Holger Levsen:
>He has worked as a translator (for Norwegian) on Tux Typing, and is
> interested in translating Tux Math too.
I have now added a Norwegian Nynorsk translation to Tux Math. I have also
changed Tux Math to use standard gettext.
All this is still highly experimental, but seems to work. I get the main menus
completely translated, and even non-ASCII character work (I only needed to
change TTF_RenderText* to TTF_RenderUTF8*).
I haven't updated the makefiles to handle updating and installing the
translation files yet. (I *hate* makefiles.)
To see the Norwegian Nynorsk translation in action, go to the 'src/po' folder
and run the following commands:
msgfmt nn.po (this create the 'compiled' file 'messages.mo')
cp messages.mo /usr/share/locale/nn/LC_MESSAGES/tuxmath.mo
(or to '/usr/local/share/...' or wherever Tux Math is installed)
Now start Tux Math, and everything will be in Norwegian. You will probably
need to have the Norwegian locale installed on your system for this to work.
For future string: Every string that should be translatable should be wrapped
in a '_' function. '_()' is shorthand for 'gettext()'. Example:
"This is a translatable string" --> _("This is a translatable string")
Sometimes it's not possible to do this directly. Then you can use 'N_()'
(shorthand for 'gettext_noop()'), as detailed here:
Karl Ove Hufthammer