Android: Localization

The next step in development Android application will be localization. I’ve read documentation from official site and from and decided to describe it.

Sequence of resources lookup
How does android lookup the resources from applications?
The example of lookup steps below:

  1. ‘res/values-en-rUS/strings.xml
  2. ‘res/values-en/strings.xml
  3. ‘res/values/strings.xml

Firsltly Android looks for resources in en-rUS folder if not found, looks in -en folder and just after it in default. If resource has been found then  the search stops.

Dismantle folders structure
The next question that worried me : What does it mean -rUS why is not just en?
The answer is, There are countries with two or more official languages for example Switzerland but there is no Swiss language just French or/and German. The fisrt -<symbol>- (in our example -en-) means language-r means region and after -r name of region. For instance for French language in Switzerland will be
This rules works for other resources like pictures and so on.

If you want to localize your application just:

  • create folders for all localized resources using above convention
  • put localized files into folders
  • start your application

P.S. And yes you must not to use strings in code just from resource files.

And that is all …


Leave a Reply

Your email address will not be published.