globalizejs / globalize

A JavaScript library for internationalization and localization that leverages the official Unicode CLDR JSON data
https://globalizejs.com
MIT License
4.8k stars 605 forks source link

Region Override Support #867

Open AlexandreGarino opened 5 years ago

AlexandreGarino commented 5 years ago

According to the CLDR documentation, we can specify a region overriding the region specified in the language identifier.

Does Globalize support this extension?

If yes, any help would be greatly appreciated.

rxaviers commented 5 years ago

Cldrjs (used by globalize) should identify such subtag, but it's not used by Globalize. Proposal is welcome.

let g = new Globalize("en-GB-u-rg-uszzzz");
g.cldr.attributes['u-rg']
// > "uszzzz"