Multilanguage support

Multilanguage support

Postby StefanP.MUC » 28 Feb 2011, 10:33

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.
StefanP.MUC
 

Re: Multilanguage support

Postby oln » 28 Feb 2011, 11:11

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.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: Multilanguage support

Postby StefanP.MUC » 28 Feb 2011, 11:25

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.
StefanP.MUC
 

Re: Multilanguage support

Postby svenskmand » 28 Feb 2011, 15:21

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.
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Multilanguage support

Postby andrewbuck » 28 Feb 2011, 16:03

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
andrewbuck
OD Moderator
 
Posts: 563
Joined: 20 Dec 2009, 01:42

Re: Multilanguage support

Postby StefanP.MUC » 28 Feb 2011, 16:07

I could offer German translation.
StefanP.MUC
 

Re: Multilanguage support

Postby andrewbuck » 28 Feb 2011, 16:10

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
andrewbuck
OD Moderator
 
Posts: 563
Joined: 20 Dec 2009, 01:42

Re: Multilanguage support

Postby svenskmand » 28 Feb 2011, 16:12

Sounds good, I will make Danish then :)
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Multilanguage support

Postby Danimal » 28 Feb 2011, 21:13

Spanish here.
User avatar
Danimal
OD Moderator
 
Posts: 1407
Joined: 23 Nov 2010, 13:50

Re: Multilanguage support

Postby oln » 28 Feb 2011, 21:15

And Norwegian here!
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: Multilanguage support

Postby StefanP.MUC » 25 Mar 2011, 15:56

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
StefanP.MUC
 

Re: Multilanguage support

Postby svenskmand » 25 Mar 2011, 16:10

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.
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Multilanguage support

Postby StefanP.MUC » 25 Mar 2011, 17:08

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.
StefanP.MUC
 

Re: Multilanguage support

Postby StefanP.MUC » 20 Apr 2011, 16:01

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.
StefanP.MUC
 

Re: Multilanguage support

Postby svenskmand » 20 Apr 2011, 18:01

Nice :) Then we will soon have danish :), not that I care, but somebody might :P
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Multilanguage support

Postby oln » 20 Apr 2011, 18:42

Okay, then we need to have kartofler and marmelade in the eatery!
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: Multilanguage support

Postby svenskmand » 20 Apr 2011, 20:43

:)
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Multilanguage support

Postby StefanP.MUC » 26 Apr 2011, 11:03

I just added the latest tinygettext code to the project.
StefanP.MUC
 

Re: Multilanguage support

Postby svenskmand » 26 Apr 2011, 11:46

So we can do the actual translations now? Or do you still need to replace the existing strings with calls to gettext?
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Multilanguage support

Postby StefanP.MUC » 26 Apr 2011, 12:04

I did not implement anything now, only uploaded the needed files.
StefanP.MUC
 

Re: Multilanguage support

Postby svenskmand » 26 Apr 2011, 12:08

Ahhh ok :)
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: Multilanguage support

Postby StefanP.MUC » 27 Apr 2011, 12:27

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?
StefanP.MUC
 

Re: Multilanguage support

Postby oln » 27 Apr 2011, 12:54

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).
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: Multilanguage support

Postby StefanP.MUC » 27 Apr 2011, 14:49

OK, that sounds like a good way. I'll do this. Thanks. :)
StefanP.MUC
 

Re: Multilanguage support

Postby StefanP.MUC » 27 Apr 2011, 15:47

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
StefanP.MUC
 

Who is online

Users browsing this forum: No registered users and 1 guest