GLBasic forum

Main forum => GLBasic - en => Topic started by: pinete on 2011-Sep-14

Title: How to know the language of the iPhone?
Post by: pinete on 2011-Sep-14
Hi all!
I would like to know how it is possible to know the iPhone default language.
Talking with people who has develop multilanguage games, they've told me they just look the default language settings on the phone to choose the app language automatically, no icons, no flags and no different apps for each territory, just access to phone info in order to setup this.
How this possible?

best!
Title: Re: How to know the language of the iPhone?
Post by: ampos on 2011-Sep-14
Code (glbasic) Select
lang$ = PLATFORMINFO$("LOCALE")

es=spanish, us, uk, de, fr,...
Title: Re: How to know the language of the iPhone?
Post by: Crivens on 2011-Sep-14
Nice. That's quite useful. Does it also work for WebOS/Android/Anything else?

Now I used to be quite good at Welsh.....

Cheers
Title: Re: How to know the language of the iPhone?
Post by: pinete on 2011-Sep-14
Thanks a lot Ampos!! ;) much appreciated!
quite easy :)
best!!
Title: Re: How to know the language of the iPhone?
Post by: BdR on 2011-Sep-14
Quote from: Crivens on 2011-Sep-14
Nice. That's quite useful. Does it also work for WebOS/Android/Anything else?
Actually, on iphone/ipad you get just two letter codes in lower case like us, gb, de, au etc. (see this list (http://goes.gsfc.nasa.gov/text/web_country_codes.html)). On Palm Pre and other WebOS devices you get 5 character codes like de_de, en_gb, en_us etc. I don't know what codes it returns on Android devices..

btw, I'd use this code to initially set the language of your app, but then also allow the user to change the language in the options screen. I know at least in the Netherlands quite a few people prefer English to Dutch when it comes to language in games or movies.