[英]Why can't I add localization to my iOS app?
I'm trying to add a localization. 我正在尝试添加本地化。 I've read all those localization/internationalization guides from Apple and raywenderlich.com.
我已经阅读了Apple和raywenderlich.com的所有本地化/国际化指南。 I've marked all my code with NSLocalizedString macro, I've used genstrings to create Localizable.strings.
我用NSLocalizedString宏标记了我的所有代码,我使用了genstrings来创建Localizable.strings。 But somehow I'm missing some important step.
但不知怎的,我错过了一些重要的步骤。
When I try to add localization to my Localizable.strings I'm somehow restricted to English only. 当我尝试将本地化添加到我的Localizable.strings时,我仅限于英语。
When I try to add localization to project via "Editor"->"Add Localization" all language options are disabled. 当我尝试通过“编辑器” - >“添加本地化”向项目添加本地化时,将禁用所有语言选项。
Does anybody have any thoughts as to why am I restricted to English only? 有没有人想过为什么我只限于英语? What have I missed?
我错过了什么?
I've tried to add localization to other projects with the same result. 我试图将本地化添加到具有相同结果的其他项目中。 :(
:(
You need to first add your localizations to your project. 您需要先将本地化添加到项目中。 Click on the project file, ensure that the project, not the target, is selected in the middle pane and then choose the "Info" screen.
单击项目文件,确保在中间窗格中选择了项目而非目标,然后选择“信息”屏幕。 There's a area called "Localizations" where you can add languages.
有一个名为“Localizations”的区域,您可以在其中添加语言。 You should then be able to localize your resources.
然后,您应该能够本地化您的资源。
Another possible issue is that you are not selecting appropriately the project, which leads to all languages in the Add localization list being disabled. 另一个可能的问题是您未正确选择项目,这会导致禁用“ 添加本地化”列表中的所有语言。
By default the target may be selected, make sure you select the project instead. 默认情况下,可以选择目标,确保选择项目。 Then you can use the Add localization normally.
然后您可以正常使用添加本地化 。
Something which kept me busy for too long. 让我忙碌太久的东西。 I looked over the language I needed (Swedish) in the first list and took the one from the "Other" list.
我在第一个列表中查看了我需要的语言(瑞典语),并从“其他”列表中选择了一个。 Well my phone or emulator didn't change at all to Swedish.
好吧,我的手机或模拟器根本没有改变瑞典语。 But when I took Swedish from the first list it got nicely updated when changing the language settings.
但是当我从第一个列表中选择瑞典语时,它在更改语言设置时得到了很好的更新。
使用Xcode 6,您可以通过项目设置完成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.