在 iOS 8.1模拟器上改变语言不起作用

如果我把 iOS 8.1模拟器上的语言改成任何语言,并尝试用

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

我拿回“ en”。我试过重置导航器,等等。我使用 iOS 7.1运行时(在 Xcode 5.1.1中)尝试过这种方法,它工作得很好。有人找到解决这个问题的办法了吗?

27356 次浏览

use [[NSLocale availableLocaleIdentifiers]

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

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

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.

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