Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fluent-langneg] Support BCP47 extended language subtags #551

Open
tusooa opened this issue May 1, 2021 · 3 comments · May be fixed by #605
Open

[fluent-langneg] Support BCP47 extended language subtags #551

tusooa opened this issue May 1, 2021 · 3 comments · May be fixed by #605

Comments

@tusooa
Copy link

tusooa commented May 1, 2021

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.

@zbraniecki
Copy link
Collaborator

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.

@tusooa
Copy link
Author

tusooa commented Jun 14, 2022

It's more than a year. Do we have any updates on this?

@eddieantonio
Copy link

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: [] 👿

@zbraniecki zbraniecki linked a pull request Feb 7, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants