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.
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.
Source: Tips4all, CCNA FINAL EXAM
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.
ReplyDeleteTo run it from console:
$scala DuplicatesFinder.scala /path/to/android/project
UPDATE:
I've made a project on github https://github.com/4e6/android-localization-helper, maybe someone find it helpful
This isn't automated, but it's very fast. In Eclipse, to go Window->Show View->Other->Android->Resource Explorer.
ReplyDeleteNow, under the Resource Explorer tab at the bottom (or wherever you've moved it to) look under String. Each string should have the same number of versions if you have a complete translation, so you can scan down the list in just a few seconds.
Do this for each project that has strings.
I didn't know about this until after I localized, but it's still useful (such as when I add a new string).
I'm the Product Manager for MOTODEV Studio. As @hjw mentioned, this is a feature of MOTODEV Studio called the "Localization Files Editor". This editor is similar to a spreadsheet and lets you see all your strings in one view. You can edit as a spreadsheet or the underlying XML in the same view.
ReplyDeleteMOTODEV Studio is a branded version of Eclipse, so it should work with your existing projects if you use Eclipse. If you prefer to continue using your existing Eclipse setup, you can still use MOTODEV Studio to handle the editing of the string.xml files, just so long as only one version can have the workspace open at a time.
If you have any questions about how to use it, feel free to send me a message or post on our discussion boards at developer.motorola.com
The new official Android Lint tool helps you detect this problem, and many others: http://tools.android.com/tips/lint
ReplyDeleteDo you know MotoDev Studio for Android? It features a localization tool. Within that tool all langauges are columns and all texts are rows. It's very easy to find missing translations within that "spreadsheet". The other way, find obsolet translations, is not that easy.
ReplyDeleteI suggest Amanuens that let you easily identify untranslated strings and strings that not match in master and translated files. It can, optionally, be configured to automatically keep translation files synchronized with the repository. You can also give your translators access to the service and they can find an easy to use web editor to translate your application.
ReplyDeleteThere is none which I am aware, I am favouriting the question. :) However as a best practice, I first complete the default strings.xml and translate it in the very end. I also add a small marker comment to specify end of translation and any new strings are added below that. This helps me keep track of ones which are not translated.
ReplyDelete-- UPDATE --
With latest ADT tool for eclipse you can install Lint which takes care of all the issues regarding duplicates and a lot more with its exhaustive set of warnings.