如何让 Cocoa 明白我的 iPhone 应用程序不是英文的?
我正在开发一款纯瑞典语的 iPhone 应用程序,它永远不会本地化为任何其他语言。应用中的所有字符串都是瑞典语,因此我们甚至没有 Localized.strings
。
问题是 Cocoa 生成的字符串(例如 Done 和 Edit)是英文的。我尝试将 Info.plist
中的本地化本机开发区域
设置为瑞典语
,但这没有任何改变。告诉 Cocoa 我的应用程序是瑞典语的,这应该不难,但显然确实如此。
我还尝试了很多其他的东西,但没有任何运气。那么我需要做什么才能让 Cocoa 将其字符串本地化为瑞典语?
I work on an iPhone app that is purely in Swedish and it will never be localized to any other languages. All the strings in the app is in Swedish, so we don't even have Localizable.strings
.
The problem is that the strings generated by Cocoa (such as Done and Edit) are in English. I've tried setting Localization native development region
in the Info.plist
to Swedish
, but that changed nothing. It shouldn't be harder than that to tell Cocoa that my app is in Swedish, but obviously it is.
I've also tried a bunch of other stuff without any luck. So what do I need to do to make Cocoa localize its strings to Swedish?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Cocoa 生成的字符串(例如 Done 和 Edit)是英文的,因为您的 iPhone 语言设置设置为英语(在“设置”->“常规”->“国际”->“语言”)。如果您将语言设置设置为瑞典语,您应该会看到瑞典语文本。
这就是 iPhone 默认的工作方式,如果您想更改某些按钮的文本以强制它们为瑞典语,您将必须创建它们的出口并手动更改文本。例如像这样的 UIBarButtonItem (带有默认文本 Done (英文)):
我希望这可以帮助您......
The strings generated by Cocoa (such as Done and Edit) are in English because your iPhone language settings are set to English (in Settings -> General -> International -> Language ). If you set the language settings to Swedish you should see the texts in Swedish.
This is how the iPhone works by default, if you want to change the texts of some buttons to force them to Swedish you will have to create an outlet of them and change the text manually. For example like this UIBarButtonItem (with a default text Done (in english)):
I hope that this may help you...
来自 CFBundle 文档:
我想说:你应该启用本地化,准备 swedish.lproj 并删除英语?
顺便说一句,完成&编辑应自动调整为当前活动语言。不是吗??
From the CFBundle documentation:
I would say: you should enable localizations, prepare swedish.lproj and remove English perhaps?
btw, Done & Edit shall automatically adjusted to currently active language. isn't it??
您可能必须从 XIB 中提取所有字符串并翻译它(至少这是一个一次性过程),然后重新更新 XIB。以下命令行可以帮助您做到这一点。
you might have to do use extract all strings from the XIB and translate it (at least it is a one time process) and then reupdate the XIB. The following command line can help you do that.