安卓:找失踪的翻译弦资源 [英] Android: Get missing translations for strings-resources

查看:133
本文介绍了安卓:找失踪的翻译弦资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android的,你可以在 RES /价值/ strings.xml中指定默认语言环境的文本。其他的翻译可以为新的语言在 RES /值-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.

目前我不能告诉哪些字符串我还需要翻译(所以在价值/ strings.xml中,而不是在值时─$ /strings.xml 在语言的),并且所有$翻译,虽然是obsolte(于是就有了值 - $ / strings.xml中,而不是在价值/ 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.

推荐答案

有趣的问题。我已经写了简单的脚本找到在Android项目重复资源的 https://gist.github.com/1133059 。这是丑陋的,我知道,但我会重写它在几天之内,也许建立在GitHub上的一个项目。 从控制台运行:
$斯卡拉DuplicatesFinder.scala /路径/要/安卓/项目

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 <一做了一个项目href="https://github.com/4e6/android-localization-helper">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

这篇关于安卓:找失踪的翻译弦资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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