在 iOS 8.1 模拟器上更改语言不起作用 [英] Changing language on iOS 8.1 simulator does not work

查看:27
本文介绍了在 iOS 8.1 模拟器上更改语言不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我将 iOS 8.1 模拟器上的语言更改为任何语言并尝试从代码中检测到这一点

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);

我得到en".我已经尝试过重置导航器等.我已经使用 iOS 7.1 运行时(在 Xcode 5.1.1 中)进行了尝试,并且效果很好.有没有人设法找到解决此问题的方法?

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?

推荐答案

根据发行说明,这是一个已知问题.有一个解决方法.如果你去编辑方案..."然后选项"选项卡有一个应用程序语言"选项.这只会影响当前的运行设置,而不影响应用,就像更改设备的语言一样.

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.

这篇关于在 iOS 8.1 模拟器上更改语言不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆