xcode CFBundleLocalizations info.plist - 如何放置多种语言
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8350151/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
CFBundleLocalizations info.plist - How to put multiple languages
提问by Teofilo Israel Vizcaino Rodrig
I cannot find the answer for this question anywhere. I'm new to Xcode. I have developed two multilanguage iPhone apps and cannot upload them to iTunes Connect because I'm getting the famous error "the value for the info.plist key cfbundlelocalizations is not of the required type for that key". Everybody says that it's because I need to put there an array of values, but I don't know how to do it. If I need for example, English and French, what should I to put there? Something like this (0=en, 1=fr)?
我在任何地方都找不到这个问题的答案。我是 Xcode 的新手。我开发了两个多语言 iPhone 应用程序,但无法将它们上传到 iTunes Connect,因为我收到了著名的错误“info.plist 键 cfbundlelocalizations 的值不是该键所需的类型”。每个人都说这是因为我需要在那里放置一组值,但我不知道该怎么做。例如,如果我需要英语和法语,我应该在那里放什么?像这样(0=en,1=fr)?
回答by justin
The plist editor in Xcode seems to insist that it should be a string... if you want an array, try opening the plist file in a text editor, and adding this after a value:
Xcode 中的 plist 编辑器似乎坚持它应该是一个字符串......如果你想要一个数组,请尝试在文本编辑器中打开 plist 文件,并在一个值后添加:
<key>CFBundleLocalizations</key>
<array>
<string>English</string>
<string>French</string>
</array>
so your plist would look like this:
所以你的 plist 看起来像这样:
...
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleLocalizations</key>
<array>
<string>English</string>
<string>French</string>
</array>
...