Search code examples
androidinternationalizationmultilingual

How to make sure every string from particular xml is translated in another xml in Android? Any good practices?


Lets say i have 2 languages in 2 different xmls, when I develop my app, I create more strings in strings.xml. Sometimes I don't want to translate it right away, sometimes I can forget. How can I later check and compare both xmls and make sure everything is translated?


Solution

  • Use Android Lint,

    http://tools.android.com/tips/lint

    It specifically checks for just that case.

    From,

    http://tools.android.com/tips/lint-checks

    MissingTranslation

    Summary: Checks for incomplete translations where not all strings are translated

    Priority: 8 / 10 Severity: Fatal Category: Correctness:Messages

    If an application has more than one locale, then all the strings declared in one language should also be translated in all other languages.

    By default this detector allows regions of a language to just provide a subset of the strings and fall back to the standard language strings. You can require all regions to provide a full translation by setting the environment variable ANDROID_LINT_COMPLETE_REGIONS.

    If you are using a recent ADT, you can run it directly from Eclipse by right clicking your project > android tools > run lint.