XCode 4 中捆绑包显示名称的本地化失败
我有一个以两种语言本地化的应用程序。我正在尝试根据所选的本地化更改捆绑包显示名称。 在 Internet 上的许多文章中,这是通过本地化 info plist 文件来完成的。
我正在使用 XCode 4,它会自动创建一个包含包显示名称的 MyProject-Info.plist 文件。 一旦我尝试本地化它(即使只添加了第一种语言),我就无法再构建应用程序,导致项目属性中“摘要 -> iOS 应用程序目标”部分中的标识符字段变为空白(并且我无法编辑它)。
项目的文件结构中发生的情况是,原始 MyProject-Info.plist 文件被移动到 en.lproj 文件夹,并复制到我拥有的其他 *.lproj 文件夹中(每种支持的语言一个)。
有什么提示吗?
I have an app that is localized in two languages. I'm trying to change the bundle display name according to the selected localization.
In many articles on the Internet, this is done localizing the info plist file.
I'm using XCode 4 and it automatically creates a MyProject-Info.plist file containing the bundle display name.
As soon as I try to localize it (even having only the first language added) I cannot build the app anymore, cause the Identifier field in the "Summary -> iOS Application Target" section in the project properties becomes blank (and I cannot edit it).
What happens in the file structure of the project is that the original MyProject-Info.plist files is moved to the en.lproj folder, as well as duplicated into the other *.lproj folders I have (one for each supported language).
Any hint?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
1.选择“InfoPlist.strings”文件
2.打开“文件检查器”
3.在本地化部分添加您的本地化语言。
4.打开“InfoPlist.strings(English)”文件,添加 CFBundleDisplayName = "Yours English Application Display Name";
5.打开“InfoPlist.strings(您的本地语言)”文件,添加 CFBundleDisplayName = "您的本地应用程序显示名称";
1.select "InfoPlist.strings" file
2.Open “File Inspector"
3.add your localization language at Localization Section.
4.Open "InfoPlist.strings(English)" file, add CFBundleDisplayName = "Yours English Application Display Name";
5.Open "InfoPlist.strings(your local language)" file, add CFBundleDisplayName = "Yours Local Application Display Name";
冒着多余的风险,让我澄清一下(因为我现在已经对此进行了测试),技巧是翻译 InfoPlist.strings 而从不翻译 MyProject-Info.plist。
Taking the risk of being redundant, let me just clarify (as I've tested this right now) that the trick is to translate the InfoPlist.strings and never the MyProject-Info.plist.