How to know the language of the iPhone?

Previous topic - Next topic

pinete

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!

ampos

Code (glbasic) Select
lang$ = PLATFORMINFO$("LOCALE")

es=spanish, us, uk, de, fr,...
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Crivens

Nice. That's quite useful. Does it also work for WebOS/Android/Anything else?

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

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

pinete

Thanks a lot Ampos!! ;) much appreciated!
quite easy :)
best!!

BdR

#4
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). 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.