iPhone - 系统字符串未在设备上本地化
我使用 XCode 4 构建了一个项目,从现在起我就在模拟器上运行。我注意到系统类型“编辑”和“保存”按钮中的字符串是英语,但我的模拟器中的所有内容都设置为法语。我怀疑存在类似于 XCode 3 中的错误。
但现在我在我的纯法语配置的 iPhone 上运行,这些按钮仍然是英文,并且没有像我在其他应用程序中那样本地化。可以使用。
我注意到在我的 info.plist 中,“本地化本机开发区域”默认设置为“en”。我已在下拉菜单中将其更改为“Fr”或“France”,但这不会改变任何内容。
我如何纠正这个问题以使这些按钮显示本地化标题?
I build a project using XCode 4 and I was running on the simulator since now. I had noticed that the strings in System type "Edit" and "Save" buttons where in english, but everything in my simulator was set to french. I suspected a bug like the one I had in XCode 3.
But now I'm running on my pure french configured iPhone, and those buttons are still in english, and are not localised as in other apps I can use.
I noticed that in my info.plist, the "Localization native development region" was set to "en" by default. I've changed this to "Fr" or "France" in the drop down menu, but that does not chage anything.
How may I correct this to make those buttons show a localized title ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我基本上有同样的问题,但黑蛙的回答并没有真正帮助我。我做了一些研究,发现如下:
本地化主要基于捆绑包。使用 info.plist,您可以添加捆绑包中没有的本地化内容,但无法删除捆绑包中存在的本地化内容。
在 Xcode 4 中添加法语本地化的首选方法是执行以下操作:
+
并选择您希望应用程序使用的语言(法语)如果您不想支持英语,则需要执行两个额外步骤:
-
并删除文件特别感谢 Nekto 谁帮我解决了这个问题。
I had basically the same question, but Black Frog's answer didn't really help me. I did some research and this is what I found out:
The localization is primarily based on the bundle. With info.plist you can add localizations that aren't in the bundle, but you can't remove localizations that are present in the bundle.
The preferred way to add a French localization in Xcode 4 is to do the following:
+
and select the language you want you're app to use (French)If you don't wan't to support English there are two additional steps:
-
and delete the filesSpecial thanks to Nekto who helped me figure this out.
您必须创建 nib 文件的本地化版本。或者,您可以将每个按钮/标签的文本设置为视图加载中的本地化字符串。
You have to create localized version of your nib files. Or you can set the text of each button/label to a localized string in view load.