Search code examples
androideclipsetranslationandroid-lint

How to use tools:locale for strings.xml files?


Background

Lint has a relatively new feature, so that it will warn us about missing translation only for languages that we choose, but i don't get how to use it.

The problem

for some reason, Lint still warns me about languages that i don't intend on translating yet.

What i've tried

for example, currently i want to only have 2 languages : english ("en") and hebrew (which is sadly both "iw" and "he" ) .

so i have strings files in the folders :

  • values (for english)
  • "values-he" and "values-iw" (for hebrew) .

i've tried putting the new attribute in the english file as such :

<resources xmlns:tools="http://schemas.android.com/tools" tools:locale="en,iw,he">
...

The question

what is the right way to do it?


Solution

  • Looking here it seems that it's to be used into resource files to indicate the default language. So you can specify only one locale code.

    should correspond to a language

    Moreover it seems to be used only to disable spell-checker