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

language fallback mechanism for webExtensions #35

Open
carlosjeurissen opened this issue Oct 27, 2022 · 1 comment
Open

language fallback mechanism for webExtensions #35

carlosjeurissen opened this issue Oct 27, 2022 · 1 comment
Assignees

Comments

@carlosjeurissen
Copy link

In the webExtensions w3c, we wanted to tackle locale fallback mechanisms, see: w3c/webextensions#296.

Currently browsers handle this differently so we were wondering if there is a clear preference for one over the other and if you have some suggestions here.

In your Working Draft, it is mentioned there should be a clear deterministic fallback mechanism. Yet it does not seem to specify what the behaviour should be.

@aphillips
Copy link
Contributor

Thanks @carlosjeurissen for the note.

There are several fallback mechanisms available and these are used by different technologies in different ways. The simplest fallback mechanism is described in BCP47 and involved progressive removal of subtags. A more advanced matching scheme is described by Unicode's CLDR project and is used internally by libraries such as ICU. Since ICU forms the basis for I18N APIs in most of the major browsers, this is probably the most useful algorithm.

Note that JavaScript provides these two fallbacks in Intl (see here, where "best fit" means the Unicode algorithm in practice).

I agree that we should update our WD to be clearer, since this standardization is now fairly solid.

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

No branches or pull requests

2 participants