views:

959

answers:

2

I'm localizing my iPhone app for multiple languages, and in addition to changing some of the strings I need to change some backgrounds. Is it possible to query the iPhone and get the user's language code?

Thanks!

A: 

Take a look at NSLocale:

NSString   *language = [[NSLocale currentLocale] objectForKey: NSLocaleLanguageCode];
NSString   *countryCode = [[NSLocale currentLocale] objectForKey: NSLocaleCountryCode];
Ben Gottlieb
A: 

solved my own question!

NSString *language = [[NSLocale preferredLanguages] objectAtIndex:0];
NSLog(@"The device's specified language is %@", language);
John Frankes