Jul 17, 2014

[iOS] Getting current device language in iOS?

NSString * language = [[NSLocale preferredLanguages] objectAtIndex:0]; 
Or

NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
NSArray* arrayLanguages = [userDefaults objectForKey:@"AppleLanguages"];
NSString* currentLanguage = [arrayLanguages objectAtIndex:0]; 

Or

NSString *language = [[[NSBundle mainBundle] preferredLocalizations] objectAtIndex:0];

No comments:

Post a Comment