4

I read the localization in Android. Here for we need to create different values's folder for each language.

for e.g.

  1. res/values/strings.xml : Contains English text for all the strings that the application uses, including text for a string named title.
  2. res/values-fr/strings.xml : Contain French text for all the strings, including title.
  3. res/values-ja/strings.xml : Contain Japanese text for all the strings except title.

Now I want to give support for Danish language then what should I name to value's folder ?

user2060383
  • 979
  • 1
  • 14
  • 32

4 Answers4

3

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. 
Community
  • 1
  • 1
joao2fast4u
  • 6,868
  • 5
  • 28
  • 42
3

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.

Jon Hanna
  • 110,372
  • 10
  • 146
  • 251
1

Via http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes, you would use res/values-da/strings.xml.

David
  • 7,028
  • 10
  • 48
  • 95
1

Android value's folder is following the locale naming specified by ISO-639-1.

Danish language, according to the standard, have the locale da, so your folder will be values-da.

The same rule applies to all languages.

Reference: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes

Cowcow02
  • 561
  • 1
  • 4
  • 5