Android localize es-r419

前端 未结 4 1442
情歌与酒
情歌与酒 2021-02-01 21:51

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.

4条回答
  •  不思量自难忘°
    2021-02-01 22:40

    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).

提交回复
热议问题