Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSLocale preferredLanguages is retrieving always 'en' language

Tags:

ios

I'm trying to get the correct language in my device (is NOT in the SIMULATOR) with the following code:

 NSString * languageLocale = [[NSLocale preferredLanguages] objectAtIndex:0];

And it is always 'en' but my current language is set to Spanish

Any thoughts why is retrieving always 'en' and not the current device language?

like image 556
ZetaPR Avatar asked May 24 '16 14:05

ZetaPR


1 Answers

I've to face the same issue. In my case, it was solved by setting the Application Language as System Language in Edit Scheme.

Here is the way:

Edit Scheme -> Options -> Application language -> System Language.

like image 172
Ramakrishna Avatar answered Sep 25 '22 17:09

Ramakrishna