Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Internationalization, translation, localization, i18n

Author
Message
idstam
12
Years of Service
User Offline
Joined: 4th Oct 2011
Location: Upplands Väsby / Sweden
Posted: 6th Jun 2012 23:38
Are there any build in functions in Tier 1 to help translate an application?

If not: Can I get the current language from the device in tier 1?

Since I keyword stuffed the title any advice in translating a gamie is a fair comment
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 7th Jun 2012 00:51 Edited at: 7th Jun 2012 00:51
Do you mean functions for translating human language?

The answer to that is no.

As far as I know there are no Tier 1 functions for determining any user type settings for a device or platform.

About the only thing I can suggest is storing displayed strings in different languages in text files that have an index that you use to select the string and then let the user select the language as an option and load the correct language file.

You could use GetStringToken to split the lines on ':' (or some other character)

A file might look something like this -
game_text_en.txt:


game_text_sp.txt:


I do this for one of my client's sites and it is a royal pain in the butt.

Cheers,
Ancient Lady
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 7th Jun 2012 08:25
It would be useful to get the current user's locale setting. There are simple OS calls on all platforms to determine this, returning a string like "en_GB".

Then, as Ancient Lady says, you can either load text files using constants, or have a series of string arrays and select the appropriate one for text.

-- Jim
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 7th Jun 2012 11:03
+1 for a "getLanguage" command. It's much nicer for the language to be chosen automatically by software. If we have a way of determining the language the user is currently using we can make a decision whether to display their chosen language or offer an option on loading the game for the first time.

MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 8th Jun 2012 03:57
+1 too !
pprem
11
Years of Service
User Offline
Joined: 14th Jun 2012
Location: Paris, France
Posted: 15th Jun 2012 01:38
+1 too

--
Patrick P.
http://www.gamolf.fr
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Jun 2012 11:13
I second the method suggested by Ancient Lady, I use this one and the company I work for uses the same principle (3,000+ messages and constants in 13 languages). It can be awkward at first, but the payoff is worth it.

Using more meaningful codes also helps to track down the text you want (e.g mnu_nnn for menu options). I also use a getText() function to simplify it, and this accepts a default value which makes debugging and tracking your text so much easier.

I haven't written it yet, but I plan to make a small utility that reads the source code and extracts the getText() parameters into a default language file.

Login to post a reply

Server time is: 2024-04-27 16:36:41
Your offset time is: 2024-04-27 16:36:41