1

I am using the following code:

NSLocale *locale = NSLocale.currentLocale;
NSString *countryCode = [locale objectForKey:NSLocaleCountryCode];
NSString *langaugeCode =[locale objectForKey:NSLocaleLanguageCode];

and the language code always comes back to be en_US even if I switch the language of my iPad. Any suggestions of what I might be doing wrong?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Rajeshwar
  • 11,179
  • 26
  • 86
  • 158
  • This is basically a duplicate of [NSDateFormatter and current language in iOS11](https://stackoverflow.com/questions/46205763/nsdateformatter-and-current-language-in-ios11). – rmaddy May 02 '19 at 04:13
  • Try this code 'NSString * language = [[NSLocale preferredLanguages] firstObject]; ' – Darshan Kunjadiya May 02 '19 at 05:32

0 Answers0