Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect iOS language [closed]

How to detect the iOS language in iOS?

like image 684
Rafael Avatar asked Dec 17 '22 18:12

Rafael


1 Answers

[[[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"] objectAtIndex:0]]; // us

This writes into a NSString the current country code so you can detect the current language.

Or use this to get the current language and the region:

NSString *locale = [[NSLocale currentLocale] localeIdentifier]; // en_US
like image 135
Paul Avatar answered Dec 28 '22 08:12

Paul