Page 1 of 2

Multilanguage support

PostPosted: 28 Feb 2011, 10:33
by StefanP.MUC
Hope this is the right forum.

Does the game has multilanguage support yet? Or ist the code ready for a multilanguage implementation? If it has not, I think there shouldn't be to much "hardcoded" english strings then in the upcoming development. To make it easier later, when multilanguage support will be implmented.

Just a suggestion.

Re: Multilanguage support

PostPosted: 28 Feb 2011, 11:11
by oln
The game does not have multilanguage support at this stage. However I agree that text strings should be kept out of the code when possible and we should keep this in mind when developing.
Support for multiple languages is something that probably won't be prioritised any time soon though, getting the basic gameplay working is more important.

Re: Multilanguage support

PostPosted: 28 Feb 2011, 11:25
by StefanP.MUC
Yup, I agree on priority. But the code should now already be developed with the possibility of easy multilang integration in the future without then having to rewrite everything.

Re: Multilanguage support

PostPosted: 28 Feb 2011, 15:21
by svenskmand
Yes multiple language support is a must have for any serious project :)

The implementation should be easy, I am working on a course administration system at my university called CourseAdmin which also has multiple language support. There it is simply implemented as a file of string value pairs, where the key is some english keywork that makes sense in the context and then the value is the phrase in the language implemented. Then there is a file like this for each implemented language. Pretty simple and it works well.

Re: Multilanguage support

PostPosted: 28 Feb 2011, 16:03
by andrewbuck
Yeah, I think that is exactly how qt does it (and by extension the i8n project). The strings it uses for keywords can also be the exact english translation, which is nice because it still lets you hardcode in strings anywhere you want in the code, you just wrap them in a translate() function call, which translates them on the fly to whatever the user chooses.

This is something that is not very difficult at all to do in the source code, so if it is something people are interested in (and if we have people willing to make translations), I will try to put it in for the next release.

PS. Just to clarify, by next release I mean the one after the one we are working on putting together in the next couple days.

-Buck

Re: Multilanguage support

PostPosted: 28 Feb 2011, 16:07
by StefanP.MUC
I could offer German translation.

Re: Multilanguage support

PostPosted: 28 Feb 2011, 16:10
by andrewbuck
Well, I will look into that then. I don't speak any other languages well enough to do a proper translation so it was something I never thought about.

-Buck

Re: Multilanguage support

PostPosted: 28 Feb 2011, 16:12
by svenskmand
Sounds good, I will make Danish then :)

Re: Multilanguage support

PostPosted: 28 Feb 2011, 21:13
by Danimal
Spanish here.

Re: Multilanguage support

PostPosted: 28 Feb 2011, 21:15
by oln
And Norwegian here!

Re: Multilanguage support

PostPosted: 25 Mar 2011, 15:56
by StefanP.MUC
Any news on this? I'm not really aware of how C++ can handle non-latin strings (like cyrillic or japanese, unicode and this whole stuff needed for proper l10n), but if it comes down to only write something like a "string translate(string key)" function I can do this.

If we prefer a ready-to-use solution, however, then there seem to be only two solutions out there:
GNU gettext
ICU

Re: Multilanguage support

PostPosted: 25 Mar 2011, 16:10
by svenskmand
This should be trivial, execpt for one thing, namely displaying the fonts in the game, does CEGUI support unicode fonts? If that is the case then we should be good. At least I cannot see other problems than that, how about you?

Edit: a quick google gave this, which clearly says that CEGUI supports unicode, so we should be fine. But it still might be a good idea to use GNU gettext, to standardize how we implement the muli-lang support.

Re: Multilanguage support

PostPosted: 25 Mar 2011, 17:08
by StefanP.MUC
I don't know how much strings outside of CEGUI will be there in the future. The console output, for example, is currently not done with CEGUI. But this will be removed later, won't it?

If we only will have CEGUI strings in the future than it shouldn't be much of a problem to assign strings that are read from a UTF-8 textfile:
http://www.cegui.org.uk/docs/current/cl ... tring.html
In thsi case (CEGUI-only localisaton), I'd say to not use any external stuff (it just bloats the code up). The gettext or ICU solution should only be used if we need localisation outside CEGUI.

Re: Multilanguage support

PostPosted: 20 Apr 2011, 16:01
by StefanP.MUC
I just found this over at the guys from SuperTuxKart:
http://supertuxkart.sourceforge.net/Gettext_on_windows
Gettext seems to have some limitations on Windows (if it works at all).

They use tinygettext:
https://code.google.com/p/tinygettext/

Seems very easy to use. Simply put it in our project in a separate subfolder and #include "tinygettext.hpp". Everything else seems to be the same as with gettext.

Re: Multilanguage support

PostPosted: 20 Apr 2011, 18:01
by svenskmand
Nice :) Then we will soon have danish :), not that I care, but somebody might :P

Re: Multilanguage support

PostPosted: 20 Apr 2011, 18:42
by oln
Okay, then we need to have kartofler and marmelade in the eatery!

Re: Multilanguage support

PostPosted: 20 Apr 2011, 20:43
by svenskmand
:)

Re: Multilanguage support

PostPosted: 26 Apr 2011, 11:03
by StefanP.MUC
I just added the latest tinygettext code to the project.

Re: Multilanguage support

PostPosted: 26 Apr 2011, 11:46
by svenskmand
So we can do the actual translations now? Or do you still need to replace the existing strings with calls to gettext?

Re: Multilanguage support

PostPosted: 26 Apr 2011, 12:04
by StefanP.MUC
I did not implement anything now, only uploaded the needed files.

Re: Multilanguage support

PostPosted: 26 Apr 2011, 12:08
by svenskmand
Ahhh ok :)

Re: Multilanguage support

PostPosted: 27 Apr 2011, 12:27
by StefanP.MUC
I'm currently working on the Translation class.

However, CMake still isn't my best friend. :D
Where exactly do I have to add the new tinygettext folder and files in all the CMakeLists.txt so that it is actually used while compiling and linking?

Re: Multilanguage support

PostPosted: 27 Apr 2011, 12:54
by oln
One way is adding a tinygettext subfolder under include with the headers, and one under src with the cpp files. Then put the cpp files in src/cmakelists.txt (with there tinygettext directory prefix).

Re: Multilanguage support

PostPosted: 27 Apr 2011, 14:49
by StefanP.MUC
OK, that sounds like a good way. I'll do this. Thanks. :)

Re: Multilanguage support

PostPosted: 27 Apr 2011, 15:47
by StefanP.MUC
Seems like tinygettext needs libiconv, where would I put this into the cmake scripts?

edit: Ah, they have a cmake file for this in theor repos. So, everything's good.:D