[英]How to add a localization to a settings.bundle?
My app supports two languages. 我的应用支持两种语言。 When I add a settings-bundle, it´s only in english. 当我添加一个设置包时,它只有英文版。 In Xcode 6.1 I found no way to add a localization to Settings.bundle. 在Xcode 6.1中,我发现无法向Settings.bundle添加本地化。 Did I miss something? 我错过了什么?
Nevertheless I found a working solution. 不过我找到了一个有效的解决方
1) open Settings.bundle package 1)打开Settings.bundle包
2) create new folder de.lproj (dont´t duplicate en.lproj - Finder don´t likes this) 2)创建新文件夹de.lproj(不要复制en.lproj - Finder不喜欢这个)
3) copy Root.strings from en.lproj-folder to de.lproj-folder 3)将Root.strings从en.lproj-folder复制到de.lproj-folder
4) now you can edit the new language in Xcode 4)现在您可以在Xcode中编辑新语言
It seems not working in Simulator. 它似乎不适用于模拟器。 I am using Xcode 8.2.1. 我正在使用Xcode 8.2.1。
OK. 好。 I find out the issue. 我发现了这个问题。 In my Xcode project, the file Root.plist
in Settings.bundle
, there is one item missing: Strings Filename
. 在我的Xcode项目中, Settings.bundle
的文件Root.plist
,缺少一个项目: Strings Filename
。 I added this entry and set its value to Root
, which is for language localization. 我添加了这个条目,并将其值设置为Root
,用于语言本地化。 With this missing item added, my app settings are working as expected in Simulator! 添加此缺失项目后,我的应用程序设置在模拟器中正常运行!
See my blog on this for more information . 有关更多信息,请参阅我的博客。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.