Display locale language in full

Posted by Mihai Fonoage on Stack Overflow See other posts from Stack Overflow or by Mihai Fonoage
Published on 2010-02-11T17:23:55Z Indexed on 2010/04/25 17:43 UTC
Read the original article Hit count: 316

Filed under:

Hi,

I am getting the user preferred language from the below code:

NSUserDefaults* defs = [NSUserDefaults standardUserDefaults];
NSArray* languages = [defs objectForKey:@"AppleLanguages"];
NSString *language = [languages objectAtIndex:0];

This will return something like 'en' for 'English', or 'de' for 'Deutsch'. Is there any way I can automatically get the full language name, i.e. English instead of en?

Thanks!

Mihai Fonoage

© Stack Overflow or respective owner

Related posts about iphone