Open Bug 1889845 Opened 3 months ago Updated 2 months ago

Add an API to set accept languge for normalization

Categories

(Core :: Internationalization, enhancement)

enhancement

Tracking

()

People

(Reporter: m_kato, Unassigned)

References

Details

Actually, desktop uses fixed table (or set by localizer) to set accept-language in preferences. Also, GeckoView has own functions to set it now.

From https://phabricator.services.mozilla.com/D205450#7086660

here's code in https://searchfox.org/mozilla-central/source/intl/components/src/Locale.h#439 that will handle canonicalization of deprecated language codes, among other things. It ends up calling into this code: https://searchfox.org/mozilla-central/source/intl/components/src/LocaleGenerated.cpp#104.

The advantage of using this is that these mappings are code generated from CLDR data, so they will be updated if more codes end up being deprecated in the future.

I realize that using that Locale code might be out of scope for this bug, but if you don't want to do that here, please file a follow up bug to consider doing that in the future. You might want to also consider supporting the replacements for all of the deprecated two character language codes instead of just the three you have here.

We should unified code or use an API into intl.

You need to log in before you can comment on or make changes to this bug.