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

Why is this Javascript much *slower* than its jQuery equivalent?

I have a HTML list of about 500 items and a "filter" box above it. I started by using jQuery to filter the list when I typed a letter (timing code added later): $('#filter').keyup( function() { var jqStart = (new Date).getTime(); var search = $(this).val().toLowerCase(); var $list = $('ul.ablist > li'); $list.each( function() { if ( $(this).text().toLowerCase().indexOf(search) === -1 ) $(this).hide(); else $(this).show(); } ); console.log('Time: ' + ((new Date).getTime() - jqStart)); } ); However, there was a couple of seconds delay after typing each letter (particularly the first letter). So I thought it may be slightly quicker if I used plain Javascript (I read recently that jQuery's each function is particularly slow). Here's my JS equivalent: document.getElementById('filter').addEventListener( 'keyup', function () { var jsStart = (new Date).getTime()...

Is it possible to have IF statement in an Echo statement in PHP

Thanks in advance. I did look at the other questions/answers that were similar and didn't find exactly what I was looking for. I'm trying to do this, am I on the right path? echo " <div id='tabs-".$match."'> <textarea id='".$match."' name='".$match."'>". if ($COLUMN_NAME === $match) { echo $FIELD_WITH_COLUMN_NAME; } else { } ."</textarea> <script type='text/javascript'> CKEDITOR.replace( '".$match."' ); </script> </div>"; I am getting the following error message in the browser: Parse error: syntax error, unexpected T_IF Please let me know if this is the right way to go about nesting an IF statement inside an echo. Thank you.