Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(5)
我也只是在看这个。如果您只需要一些东西来完成一些繁重的工作,并且您已经在使用 OsX,则可以使用 xsltproc 和这个简单的 xsl 来帮助您完成
xsl:
将其保存到文件、transform.xsl 或其他文件中,然后从 shell 运行以下命令:
xsltproc transform.xsl your_android_strings.xml > fileforxcode.out
这似乎生成了一些看起来正确的东西,尽管您可能需要单独处理任何格式字符串。无论如何,它可能会为您节省一些工作。
I was just looking at this as well. If you just need something to get some of the grunt work done, and you're on OsX already, you can use xsltproc and this simple xsl to get you going
The xsl:
Save this to a file, transform.xsl or something, then from a shell run the following:
xsltproc transform.xsl your_android_strings.xml > fileforxcode.out
This seemed to generate something that looked right, although you'll probably need to muck with any format strings separately. No matter what, it might save you some work.
您可以从 Android .xml 文件中提取本地化内容,然后使用最新版本的 TM 数据库工具将其添加到 iPhone .string 文件中。
很简单:
请参阅详细说明此处
You can extract localization from Android .xml file then add it to iPhone .string file with last version of TM-database tool.
It is easy:
Please see the detail instruction here
我在此处使用脚本。它将已翻译的 Android 本地化字符串文件转换为 iOS Localized.strings 文件,同时考虑字符串占位符的转换(
%1$s
变为%1$@
)。它是一个简短的 ruby 脚本,很容易理解。在构建过程开始时将其作为运行脚本链接到 Xcode。I use a script here. It converts the already-translated Android localized strings files into iOS Localizable.strings files, accounting for conversions of string placeholders (
%1$s
becomes%1$@
). Its a short ruby script and is easy to follow. Link it into Xcode as a Run Script at the beginning of your build process.如果您不想预处理字符串而只是删除 android 字符串,您还可以使用 这个 选项.xml 文件导入 iPhone 项目。
You also have this option if you don't want to preprocess the strings but just drop the android strings.xml file into the iPhone project.
这并不能真正回答您的问题,但您可以考虑为您未来的 iOS+Android 项目使用 DMLocalizedString 。目前源代码仅适用于 iOS,但我相信制作 Android 版本非常容易。
This don't really answer your question but you may consider DMLocalizedString for your future iOS+Android project. Currently the source is for iOS only, but I believe that making the Android version is pretty easy.