76
votes

If I change the language on an iOS 8.1 simulator to anything and try to detect this from code with

NSString * language = [[NSLocale preferredLanguages] objectAtIndex:0];
NSLog(@"Language: %@", language);

I get "en" back. I've tried resetting the navigator, etc. I've tried this using the iOS 7.1 runtime (in Xcode 5.1.1), and it worked fine. Has anyone managed to find a workaround to this problem?

5
You should file a bug about it.dasdom
Check the "known bugs" section of the release notes.Kevin
Currently have this simulator bug using Xcode Version 6.1 (6A1052d) and running OSX Ver 10.9.5. Correct code above returns en on simulator with language set to Chinese (simplified) while actual iPad returns "zh-Hans" as expected. Will try upgrade to OS-X X.harry
After upgrading my dev machine to Yosemite, continue to have 7.1 simulator work correctly, 8.1 continues to fail.harry
This is definitely failing still for me in an 8.1 simulator.Estel

5 Answers

168
votes

According to the release notes this is a known issue. There is a work around. If you go to "Edit Scheme..." then the "Options" tab there's an "Application Language" option. This only affects the current run settings, not the app, much like changing the language of the device.

enter image description here

1
votes

Another dupe of iOS8.1 Simulator always uses US keyboard layout despite german hardware keyboard

Known and documented bug as mentioned in the Xcode 6.1 release notes. File a radar if you want to add your +1 to the complaint list at http://bugreport.apple.com

1
votes

My simulator is in French language. When I want to check interface in English then changing the iphone language is not enough. I have to switch the region settings minimum two times.

0
votes

use [[NSLocale availableLocaleIdentifiers]

0
votes

In my case, editing schema works for region but not for language. It looks overwrite by development language. Changing developmentRegion works fine with project.pbxproj like this.

developmentRegion = ja;

enter image description here

Xcode Version 11.3.1 (11C504)

iPhoneX iOS 13.3.1