xcode info.plist 包显示名称本地化

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36675588/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 08:44:45  来源:igfitidea点击:

info.plist bundle display name localization

iosobjective-cxcodeswiftlocalization

提问by Hasen

There are a lot of posts on this but all seem to be an out of date method? It seems its done using info.plist and adding localization to it and then more info.plist files are created within for each language. It seems to be working but only ever displays the English Bundle display name no matter what system language I use. Not sure what else needs to be done. I checked it on both the simulator and a device.

有很多关于这个的帖子,但似乎都是过时的方法?似乎它使用 info.plist 完成并为其添加本地化,​​然后为每种语言创建了更多 info.plist 文件。它似乎可以正常工作,但无论我使用什么系统语言,它都只显示英文包显示名称。不确定还需要做什么。我在模拟器和设备上都检查了它。

enter image description here

在此处输入图片说明

回答by Mortgy

you need to create "InfoPlist.strings" and add languages which you want to support there, then set your bundle name and display name as the following for each language

您需要创建“InfoPlist.strings”并添加您想要在那里支持的语言,然后为每种语言设置您的包名称和显示名称如下

"CFBundleDisplayName" = "App Name";
"CFBundleName" = "App Name";

How to enable Localization and add more language to your project.

如何启用本地化并为您的项目添加更多语言。

  1. Choose your project on the tree.
  2. Choose your project.
  3. Info Tab -> Localizations.
  4. Choose which language you want to support.
  1. 在树上选择您的项目。
  2. 选择您的项目。
  3. 信息选项卡 -> 本地化。
  4. 选择您要支持的语言。

then on your strings file, when you choose it, on right side you can find which languages you want to support into this strings file.

然后在你的字符串文件上,当你选择它时,在右侧你可以找到你想要在这个字符串文件中支持哪些语言。