避免翻译 XCode 项目中的标准菜单项
我有一个 XCode 项目,其中包含使用 Interface Builder 构建的 XIB 接口文件。我正在通过使用 ibtool 提取字符串、翻译字符串并再次使用 ibtool 构建本地化 XIB 文件来构建本地化 XIB 文件。
然而,这样做意味着我必须翻译应用程序菜单中的所有项目,包括那些完全标准的项目(文件、保存、打开、最小化等)。有办法避免这种情况吗?
I have an XCode project, with the XIB interface files built using Interface Builder. I'm building localized XIB files by using ibtool
to extract strings, translating them, and using ibtool
again to build localized XIB files.
However, doing this means I have to translate all items in the application menus, including those that are completely standard (File, Save, Open, Minimize, etc.). Is there a way to avoid that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我已经开发了解决这个问题的方法。
https://www.corecode.io/index_opensource.html
寻找“Translator”,它将使用标准菜单项字符串的标准 Apple 翻译将您的 MainMenu.strings 文件翻译成十几种语言。
如果您发现 Aapple 在其基础应用程序中缺少某些字符串或语言,请发送补丁。
i've developed a solution to this problem.
https://www.corecode.io/index_opensource.html
look for "Translator", it will translate your MainMenu.strings file into a dozen languages with the standard Apple translations for the standard menu item strings.
if you find some strings or languages missing that Aapple has included in their base apps, please send a patch over.
所以,显然没有办法解决这个问题。
So, apparently no way around this.
我一直在寻找类似的解决方案一段时间,我发现了这个资源
http://www.bdunagan.com/2009/03/15/ibtool-localization-made-easy/
它在文章末尾引用了:
继续看一下,我真的希望它对您有帮助,就像它对我有帮助一样!
I have been looking for a similar solution for a while and I found this resource
http://www.bdunagan.com/2009/03/15/ibtool-localization-made-easy/
It quotes toward the end of the article:
Go ahead and take a look I really hope it helps you as much as it helped me!
翻译者 https://github.com/core-code /MiscApps/blob/master/Translator/Translator/MainMenuTranslations.plist
很酷,但如果你不想在构建中处理 30 个 MainMenu.string 文件(我个人不想) - 你可以将 MainMenuTranslations.plist 添加到你的资源中(未压缩的 230KB 很小)并像这样即时执行这个:
只需从“我希望某处有一个 UniversalTranslation.plist”中调用它
(可以通过创造性地使用 translate.google.com 自动收集)
Translator by https://github.com/core-code/MiscApps/blob/master/Translator/Translator/MainMenuTranslations.plist
is cool but if you do not want to deal with 30 MainMenu.string files in your build (I personally don't) - you can just add MainMenuTranslations.plist to your resources (230KB uncompressed is tiny) and do it on the fly like this:
just call it from
I wish there is a UniversalTranslation.plist somewhere (which could be probably collected automatically via creative use of translate.google.com)