简体   繁体   English

为什么我不能在我的iOS应用中添加本地化?

[英]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.

相关问题 为什么在iOS模拟器上看不到我的应用程序图标? - Why can't I see my app icon on iOS simulator? 为什么我不能为我的iOS应用请求促销代码? - Why can't I request promo codes for my iOS app? 如何为iOS应用添加新字符串以进行本地化? - How do I add new strings to iOS app for localization? 为什么我无法在ios swift应用中的UIScrollView上设置默认缩放? - Why I can't set the default zoom on my UIScrollView in my ios swift app? 为什么我不能在我的Swift iOS应用程序中使用CIFilter将我的图像反转回原始图像 - Why can't I invert my image back to original with CIFilter in my Swift iOS app 为什么Wingdings在iOS 5上不起作用? 为什么我的iPhone应用程序中不能使用Wingdings? - Why does Wingdings not function on iOS 5? Why can't I use Wingdings in my iPhone app? 我可以在 iOS 应用中添加“在 homekit 应用中打开”按钮吗? - Can I add a "Open in homekit app" button to my iOS app? 为什么我不能运行我的应用程序? - Why can't I run my app? 为什么在位置服务设置中看不到我的iOS应用? - Why I can't see my iOS app appears in Location Service setting? 为什么我无法从iOS应用发布到粉丝页面? - Why can't I post to a fan page from my iOS app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM