Android:获取字符串资源的缺失翻译 [英] Android: Get missing translations for strings-resources

查看:23
本文介绍了Android:获取字符串资源的缺失翻译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Android 中,您可以在 res/values/strings.xml 中指定默认语言环境中的文本.可以在 res/values-it/strings.xml 中为新语言添加额外的翻译(例如意大利语).如果未翻译字符串,则使用回退默认语言环境.

In Android, you can specify the texts in the default locale in res/values/strings.xml. Additional translations can be added for new languages in res/values-it/strings.xml (for Italian for example). If a string is not translated, the fallback-default locale is used.

目前我无法确定我还需要翻译哪些字符串(在 values/strings.xml 中也是如此,但在 values-$/strings.xml 中却没有em>对于所有语言中的 $) 并且已翻译,尽管它们已过时(在 values-$/strings.xml 中也是如此,但在 values/strings.xml 在语言中存在 $)

Currently I can not tell which strings I still need to translate (so are in values/strings.xml, but not in values-$/strings.xml for all $ in languages) and which are translated, although the are obsolte (so are in values-$/strings.xml, but not in values/strings.xml exists $ in languages)

我正在寻找一种工具,它可以为我提供缺失的翻译和过时的翻译.

I'm searching for a tool which gives me the translations which are missing and the one which are obsolete.

说实话,为命令行编写这样一个工具并不难,我简直不敢相信没有人这样做过.

To be honest, it is not that difficult to write such a tool for the command-line, I can only hardly believe nobody has already done this.

推荐答案

有趣的问题.我编写了简单的脚本来在 https://gist.github.com/1133059.这很丑,我知道,但我会在几天内重写它,也许会在 github 上创建一个项目.从控制台运行它:
$scala DuplicatesFinder.scala/path/to/android/project

Interesting question. I've wrote simple script to find duplicate resources in android project at https://gist.github.com/1133059. It is ugly, I know, but I'll rewrite it in a few days and maybe create a project on github. To run it from console:
$scala DuplicatesFinder.scala /path/to/android/project

更新:
我在 github
https://github.com/4e6/android-localization-helper 上做了一个项目,也许有人觉得有用

UPDATE:
I've made a project on github https://github.com/4e6/android-localization-helper, maybe someone find it helpful

这篇关于Android:获取字符串资源的缺失翻译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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