- Code: Select all
const CHAR* get_iphone_language_setting( void )
{
NSUserDefaults* defs = [NSUserDefaults standardUserDefaults];
NSArray* languages = [defs objectForKey:@"AppleLanguages"];
NSString* preferredLang = [languages objectAtIndex:0];
return [preferredLang UTF8String];
}
This will return one of Apples language abbreviations, I'll be honest I don't know all of them but they're fairly easy to work out in the main:
- Code: Select all
en = English
fr = French
es = Spanish
So just do a string compare with the returned string to determine the actual language which is set.
