Internationalisation In Android
Solution 1:
You should always have default strings in res/values/strings.xml
, because Android tries to use the most specific resource available. If you have for example res/values-fr/strings.xml
and res/values-de/strings.xml
and the users phone is set to English, your app will crash because neither de
nor fr
are applicable for English there are no fallback resources.
After you have specified your default strings and any translations in their respective subfolders, you can use the strings by their qualifiers. For example R.string.some_string
. Android will then use the most appropriate translation that is available for the users current device language.
All that and more is explained here: Localizing with Resources
Solution 2:
Device will load locale automatically based on system languge. No extra steps required unless you want to change locale in your app independently.
Post a Comment for "Internationalisation In Android"