xcode 删除 iOS 应用本地化
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6736493/
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
Remove an iOS app localization
提问by JoePasq
In Bombr1.2 I added a half-assed French localization, over time adding more strings to localize I've decided to drop the French localization. In Bombr 1.2.1 I removed the referenceto fr.lproj/Localizable.strings from the Xcode project but the file still exists. Now that 1.2.1 is on the app store it still says that French is a supported language.
在Bombr1.2 中,我添加了一半的法语本地化,随着时间的推移添加更多字符串进行本地化我决定放弃法语本地化。在 Bombr 1.2.1 中,我从 Xcode 项目中删除了对 fr.lproj/Localizable.strings的引用,但该文件仍然存在。现在 1.2.1 在应用商店中,它仍然说法语是一种受支持的语言。
Will removing the fr.lproj folder and resubmitting correctly display the supported languages (this is my hunch), or is it possibly that iTunes Connect will not allow you to drop support for a language?
删除 fr.lproj 文件夹并重新提交是否会正确显示支持的语言(这是我的预感),或者 iTunes Connect 是否可能不允许您放弃对某种语言的支持?
(I took a year of French in high school for fun, but not enough to translate my own app.)
(我在高中学习了一年法语是为了好玩,但不足以翻译我自己的应用程序。)
采纳答案by Vanya
try to look at the info.plist which defines localizations and I guess some work in iTunesConnect should be done as well, but before approving an app
尝试查看定义本地化的 info.plist,我想也应该在 iTunesConnect 中完成一些工作,但在批准应用程序之前
回答by gerrytan
If you want to remove app metadata localization, there's a delete menu on iTunesConnect
如果您想删除应用程序元数据本地化,iTunesConnect 上有一个删除菜单


回答by Ian
Building on the answer given by @vanya, select your project from the list and delete the language under in the "localization" section.
根据@vanya 给出的答案,从列表中选择您的项目并删除“本地化”部分下的语言。


回答by Code Roadie
To remove the localization from Xcode (I'm using 4.2 on Snow Leopard) click on the file/folder in the sidebar, "Localizable.strings" and open the File Inspector (keyboard shortcut cmd-opt-1 or View > Utilities > Show File Inspector in the menu bar). You'll see a Localization pane with your localizations listed. Select the one you want to remove and click the minus sign to delete it.
要从 Xcode 中删除本地化(我在 Snow Leopard 上使用 4.2)单击侧栏中的文件/文件夹“Localizable.strings”并打开文件检查器(键盘快捷键 cmd-opt-1 或 View > Utilities > Show菜单栏中的文件检查器)。您将看到一个本地化窗格,其中列出了您的本地化。选择要删除的那个,然后单击减号将其删除。
回答by ChrisJF
So I landed on this question, but with some specific criteria:
所以我提出了这个问题,但有一些具体的标准:
- I want to remove the base development language (English)
- I want to keep the localized language (French)
- 我想删除基础开发语言(英文)
- 我想保留本地化语言(法语)
None of the above answers worked and I couldn't find anything better on Stack Overflow. Eventually I found this gem: XCode: Remove localizations on build.
以上答案都没有奏效,我在 Stack Overflow 上找不到更好的答案。最终我找到了这个 gem:XCode: Remove localizations on build。
I develop in English, so the entire base of the app is in the English localisation. I then translated it into Finnish for the first release, but the intention was to only release the Finnish content and not the English.
Setting up a small script during a final Build phase works wonders to strip unwanted localisations:
我用英语开发,所以整个应用程序的基础都是英语本地化。然后我将它翻译成芬兰语作为第一个版本,但目的是只发布芬兰语内容而不是英语。
在最后的构建阶段设置一个小脚本可以奇迹般地去除不需要的本地化:
#Remove english
rm -r "${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/en.lproj"
# Remove base (iOS 9)
rm -r "${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/Base.lproj"
Then I had some runtime errors because some Storyboard files were localized and located in the Base.lproj folder. I worked around this by doing the following:
然后我遇到了一些运行时错误,因为一些 Storyboard 文件被本地化并位于 Base.lproj 文件夹中。我通过执行以下操作解决了这个问题:
- Un-localized those Storyboards (unchecked all languages) and then "Moved to trash"
- Dragged the Storyboards from the trash back into the project. (Basically moving the Storyboards from Base.lproj folder – which the script would delete – to the project folder.)
- 取消本地化这些故事板(取消选中所有语言),然后“移至垃圾箱”
- 将 Storyboard 从垃圾箱中拖回项目中。(基本上将故事板从 Base.lproj 文件夹(脚本将删除)移动到项目文件夹。)
Note: none of these Storyboards were actually localized (the .strings files were all empty). All the translations were properly set in code using NSLocalizedString.
注意:这些 Storyboard 实际上都没有本地化(.strings 文件都是空的)。所有翻译都使用 NSLocalizedString 在代码中正确设置。

