有没有一种简单的方法来合并 Localized.strings 文件?
问题:使用 genstrings 从项目创建 Localized.strings 文件。几周后,一些事情发生了变化,我再次运行 genstrings。新文件的 75% 已在旧文件中。如何将新文件与旧文件合并,以便旧文件包含所有 25% 新的键值对?
Problem: Using genstrings to create Localizable.strings files from a project. A few weeks later, some things changed and I run genstrings again. 75% of the new file is already in the old file. How could I merge the new file with the old file, so that the old file contains all of those 25% new key-value-pairs?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我也推荐本地化字符串合并。我在我的项目中使用它,它确实是一个易于使用且功能强大的软件。
I recommend Localizable Strings Merge too. I use it on my projects and it really a simple to use and powerful software.
我刚刚找到了本地化套件。令人难以置信的强大免费工具。我在我的项目中尝试过,它确实有效。但缺乏文档。
I just found the Localization Suite. Incredible powerful tool for free. I tried it on my project and it just works. Lacks documentation though.
我使用 脚本 来运行 genstrings,并在构建项目时自动合并现有翻译。更新的字符串由 git 或您使用的其他源代码管理系统检测到。该脚本也支持故事板和 xib 本地化。
要自动运行脚本,请将脚本放入项目根目录,然后将带有以下行的运行脚本阶段添加到项目设置中的目标构建阶段。
我的脚本基于 此帖子。我修改了它以支持 Swift 并添加参数。
I use a script to run genstrings with existing translations merged automatically when I build a project. Updated strings are detected by git or another source control you use. The script supports storyboard and xib localization too.
To run the script automatically, put the script into your project root directory, and add a Run Script phase with the following line to a target build phases in your project settings.
My script is based on the script in this post. I modified it to support Swift and to add the arguments.
像 BBEdit 这样的第三方应用程序怎么样?毕竟Localized.strings 文件是一个文本文件。 BBEdit 具有查找差异功能,您可以从旧合并到新或相反。
What about 3rd party applications like BBEdit? After all Localizable.strings file is a text file. BBEdit has a find differences feature and you can merge from old to new or opposite.
如果您安装 XCode,还会安装一个用于合并文件的标准应用程序,名为 FileMerge.app,您可以在 /Developer/Applications/FileMerge.app 中找到它
If you install XCode, there is also a standard application installed to merge files called FileMerge.app, you can find it in /Developer/Applications/FileMerge.app
我不确定,但 ReSharper 可能会帮助您。看看吧。
I'm not sure but ReSharper may help you. teake a look at it.