[fluent-langneg] Support BCP47 extended language subtags
Currently, https://github.com/projectfluent/fluent.js/blob/8991a1760a83f1f9d8900e325ecc83dcb636337c/fluent-langneg/src/locale.ts only allow the primary language subtag, and extended language subtag is not implemented.
It also does not take into account of macrolanguages. For example, requesting zh when there is cmn-Hans available will not match cmn-Hans.
Yes. We're planning to swap this for ICU4X once ICU4X matures a bit, and that will bring support for Unicode Extensions including extended langauge subtag.
It's more than a year. Do we have any updates on this?
Bumpin'.
Was trying this code, and it's totally broken:
negotiateLanguages(['es-MX'], ['es', 'en'], { strategy: "matching" })
// expected: ['es']
// got: ['es'] 👍🏼
negotiateLanguages(['es-419'], ['es', 'en'], { strategy: "matching" }));
// expected: ['es']
// got: [] 👿