Possible Duplicate:
Getting current device language in iOS?
I need the 3 letter language ISO code as it's part of a call to another service. I can use NSLocale.CurrentLocale.Identifier to get the country code, but not language the device is set to.
Possible Duplicate:
Getting current device language in iOS?
I need the 3 letter language ISO code as it's part of a call to another service. I can use NSLocale.CurrentLocale.Identifier to get the country code, but not language the device is set to.
The best you can do is:
[[NSLocale preferredLanguages] objectAtIndex:0];
Which as per Apple docs is:
An ordered list of the user's preferred languages.
Users choose a primary language when configuring a device, as described in Reviewing Language and Region Settings. They may also specify one or more secondary languages in order of preference for use when localization is unavailable in a higher priority language. Use this property to obtain the current user's ordered list of languages, presented as an array of locale identifier strings.
You can read more about that here: IETF BCP 47
You can do the mapping yourself from what you get back to the equivalent ISO 3 letter code. There are only 47 entries in what comes back from the iOS call so not that big a deal.