Skip to main content

Android: Get missing translations for strings-resources


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: Tips4allCCNA FINAL EXAM

Comments

  1. 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

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

    ReplyDelete
  2. This isn't automated, but it's very fast. In Eclipse, to go Window->Show View->Other->Android->Resource Explorer.

    Now, 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).

    ReplyDelete
  3. 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.

    MOTODEV 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

    ReplyDelete
  4. The new official Android Lint tool helps you detect this problem, and many others: http://tools.android.com/tips/lint

    ReplyDelete
  5. Do 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.

    ReplyDelete
  6. I 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.

    ReplyDelete
  7. There 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.

    -- 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.

    ReplyDelete

Post a Comment

Popular posts from this blog

[韓日関係] 首相含む大幅な内閣改造の可能性…早ければ来月10日ごろ=韓国

div not scrolling properly with slimScroll plugin

I am using the slimScroll plugin for jQuery by Piotr Rochala Which is a great plugin for nice scrollbars on most browsers but I am stuck because I am using it for a chat box and whenever the user appends new text to the boxit does scroll using the .scrollTop() method however the plugin's scrollbar doesnt scroll with it and when the user wants to look though the chat history it will start scrolling from near the top. I have made a quick demo of my situation http://jsfiddle.net/DY9CT/2/ Does anyone know how to solve this problem?

Why does this javascript based printing cause Safari to refresh the page?

The page I am working on has a javascript function executed to print parts of the page. For some reason, printing in Safari, causes the window to somehow update. I say somehow, because it does not really refresh as in reload the page, but rather it starts the "rendering" of the page from start, i.e. scroll to top, flash animations start from 0, and so forth. The effect is reproduced by this fiddle: http://jsfiddle.net/fYmnB/ Clicking the print button and finishing or cancelling a print in Safari causes the screen to "go white" for a sec, which in my real website manifests itself as something "like" a reload. While running print button with, let's say, Firefox, just opens and closes the print dialogue without affecting the fiddle page in any way. Is there something with my way of calling the browsers print method that causes this, or how can it be explained - and preferably, avoided? P.S.: On my real site the same occurs with Chrome. In the ex