Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android localize es-r419

I'm localizing my app and one of the language/region supported is Espanol-419. Android doesn't support the naming convention values-es-r419 but it does accept values-en-rGB. What name should I use to make it work?

like image 773
Taranfx Avatar asked Jan 20 '12 05:01

Taranfx


2 Answers

I don't know where r419 comes from. The only thing I could think that it would be is an LCID but 419 is for Russian, or a country code, but there's nothing for 419. Here are a list of locale codes for Spanish, perhaps the one you want is in here:

es-ar  Spanish - Argentina
es-bo  Spanish - Bolivia    
es-cl  Spanish - Chile
es-co  Spanish - Colombia
es-cr  Spanish - Costa Rica
es-do  Spanish - Dominican Republic
es-ec  Spanish - Ecuador
es-sv  Spanish - El Salvador
es-gt  Spanish - Guatemala
es-hn  Spanish - Honduras
es-mx  Spanish - Mexico
es-ni  Spanish - Nicaragua
es-pa  Spanish - Panama
es-py  Spanish - Paraguay
es-pe  Spanish - Peru
es-pr  Spanish - Puerto Rico
es-es  Spanish - Spain (Traditional)
es-uy  Spanish - Uruguay
es-ve  Spanish - Venezuela

References:

  • Microsoft's LCID table
  • ISO 3166-1
  • ISO 3166-1 Numeric

Update:

So apparently 419 is from the UN M.49 standard taken up by BCP 47 for the IETF language tag. Google's documentation on alternative resources says:

The language is defined by a two-letter ISO 639-1 language code, optionally followed by a two letter ISO 3166-1-alpha-2 region code (preceded by lowercase "r").

Clearly (by the "r" alone) you can see that these are not standard IETF language tags. Unfortunately, I believe this also means that you won't be able to find a suitable two letter region equivalent to 419. You can also check the official ISO list. It's not on there, there are only two letter tags for countries. Apparently it's very common not to support the 3-digit tags.

The only solution I can think of is to provide a default set for es and then a more specific set for a subdivision of es countries. You could provide resources for each region (like es-rAR) that you think matches up with 419, but looking at that list, I think it'd be easier to do the opposite and use es to provide resources for Latin American Spanish, and then provide resources for es-rES for Spain. As es-rES is more specific than es, it should take precedence (if the locale matches).

like image 133
kabuko Avatar answered Sep 28 '22 17:09

kabuko


Android 7.0 (API level 24) brings more robust resource resolution, and finds better fallbacks automatically. However, to speed up resolution and improve maintainability, you should store resources in the most common parent dialect. For example, if you were storing Spanish resources in the values-es-rUS directory before, move them into the values-b+es+419 directory, which contains Latin American Spanish.

Source: https://developer.android.com/guide/topics/resources/multilingual-support.html

We offered language selection in-app, so to work well on new and old phones we kept duplicate resources in values-es-rUS Español (Estados Unidos) as well as values-b+es+419 Español (Latinoamérica)

like image 45
jt-gilkeson Avatar answered Sep 28 '22 18:09

jt-gilkeson