I read the localization in Android. Here for we need to create different values's folder for each language.
for e.g.
Now I want to give support for Danish language then what should I name to value's folder ?
For Danish, you got to use values-da folder.
Edit: It turns out, according to this post that it is values-da.
Plus, according to the Android Locale
class documentation:
The language codes are two-letter lowercase ISO language codes (such as "en") as defined by ISO 639-1.
The country codes are two-letter uppercase ISO country codes (such as "US") as defined by ISO 3166-1.
The variant codes are unspecified.
For Danish generally, you would want to use res/values-da/strings.xml
.
To have strings specific to a country as well as a language you would use res/values-da-rDK/strings.xml
for Denmark, res/values-da-rGL/strings.xml
for Greenland, res/values-da-rDE/strings.xml
for Germany (there being a sizable Danish-speaking community in Southern Schleswig along with a few elsewhere in Germany), res/values-da-rFO/strings.xml
for the Faroe Islands, and so on. You can even have something like res/values-da-rFR/strings.xml
as while there isn't a large Danish-speaking population in France, nothing stops you doing something like that anyway.
You can mix these, e.g. being specific to country only for a handful of values, falling back to res/values-da/strings.xml
for everything else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With