本地化现有的iOS应用程序 [英] localize existing iOS app

查看:112
本文介绍了本地化现有的iOS应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法相信以前没有问过这个问题(或者我在编码实践中没有组织,或者我没有使用正确的关键字):我如何本地化一个不使用的现有iOS应用程序NSLocalizedString(特别是第一步,将所有字符串文字转换为NSLocalizedString)?

I can't believe this hasn't been asked before (either I'm too unorganized in my coding practices or I didn't use the right keywords): How can I localize an existing iOS app that doesn't use NSLocalizedString (specifically just the first step, converting all strings literals to NSLocalizedString)?

我理解本地化过程是如何运作的,但我不想自己更改所有文本。当然必须有一个工具可以将 @Hello World转换为 NSLocalizedString(@Hello World,无)

I understand how the localization process works, but I don't want to change all texts myself. Surely there must be a tool that can convert @"Hello World" to NSLocalizedString(@"Hello World", nil).

当然,我可以通过搜索和替换手动执行此操作,但我无法相信没有这方面的工具。

Sure I could do this manually with search and replace, but I can't believe there's no tool for this.

推荐答案

我写了一个xcode插件来做这种工作。执行脚本在xcode中很慢,所以我没有选择编写s脚本来执行它。虽然编写Xcode插件有点困难,但是没有官方文档,但是在习惯之后,玩它很有趣。

I've wrote a xcode plugin to do this kind of job. Execute script is slow in xcode, so I did not choose to write s script to do it. Although writing Xcode plugin is kind of difficult, there is not official documentation, but after get used to it, it is fun to play with it.

这是链接:

https://github.com/ nanaimostudio / Xcode-快速本地化

安装:


  1. 使用Xcode构建项目。

用法:


  1. 选择多行,按Option + Shift + D

  1. Select multiple line, press Option+Shift+D

如果没有选择,它只会转换当前行。

if no selection, it will convert only current line.

这篇关于本地化现有的iOS应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆