EddyVerbruggen / nativescript-i18n

This is a plugin for Nativescript that implements native i18n in an easy manner.
65 stars 30 forks source link

Make language-with-country tags work on Android #69

Closed odnamrataizem closed 6 years ago

odnamrataizem commented 6 years ago

Language tags such as pt-BR and en-GB now work properly on Android by adding an r before the country code (pt-rBR, en-rGB, etc.).

rborn commented 6 years ago

@odnamrataizem thanks, looks good. Before merging, can you send me a link where this is documented? I fail to understand the -r thing 😊 Thanks.

odnamrataizem commented 6 years ago

https://developer.android.com/guide/topics/resources/providing-resources.html

It's in Table 2 (Configuration qualifier names), Row "Language and region":

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

The codes are not case-sensitive; the r prefix is used to distinguish the region portion. You cannot specify a region alone.