0

I am trying to localize my app and have a few doubts. i have translate strings in spanish language and i am trying to be very specific with Region codes, so I named the folders as values-es_rES, values-es_rUS and values-es_rMX. Now there are more countries and users who like to use spanish language so i created a generic values-es folder.

I am wondering can android automatically push all mexico, US and Spain users to respective languages under their region codes and can others like chile, peru will be shown values-es language rather than my default US English?

vinny
  • 529
  • 4
  • 7
  • 16

1 Answers1

0

You have two options

  1. Use the language-region locale (ie. es_ES for Spanish/Spain or es_PE for Spanish/Peru)
  2. Use MNC/MCC codes in your resource folders, which will take presence over the locale ones.

The way you have described it, all users with a defined locale of es_XX (any region) will go to your "values-es" folder, but the US user will not, unless the US user has configured "es_US" as their locale.

Take a look at Table 2 at http://developer.android.com/guide/topics/resources/providing-resources.html

Remember that if an asset is missing from "es_ES" it will get it from "es", so only change those that are different.

s1m3n
  • 623
  • 6
  • 21
  • You have pointed exact problem I am facing "but the US user will not, unless the US user has configured "es_US" as their locale." Actually my problem is I have 2 module projects (apps App1 and App2) into the same repo, both apps have values_zh and values-zh-rTW. When I set a custom locale of the device to zh_US then the App1 picks up string from values_zh but App2 is picking from values-zh-rTW instead of values-zh. But if I add values-zh-rUS to App2 then it pick it from there. But I don't want it to pick up from values-zh (Since US can fall in to Any Region). Any idea??? TIA – Vinayak Bevinakatti Oct 23 '20 at 15:23
  • Typo in above comment "But I wanted it to pick up from values-zh". Here is my question, feel free to answer - https://stackoverflow.com/questions/64503285/android-does-not-pick-up-strings-xml-from-any-region-for-ex-values-zh-specific – Vinayak Bevinakatti Oct 23 '20 at 15:52