The next step in development Android application will be localization. I've read documentation from official site and from http://www.icanlocalize.com/ and decided to describe it.
Sequence of resources lookup.
How does android lookup the resources from applications?
The example of lookup steps below:
- ‘res/values-en-rUS/strings.xml’
- ‘res/values-en/strings.xml’
- ‘res/values/strings.xml’
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 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
res/values-fr-rCH
This rules works for other resources like pictures and so on.
Conclusion
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
Cheers!
No comments:
Post a Comment