Open Bug 1632302 Opened 4 years ago Updated 4 years ago

mozilla::intl::Locale fails to parse a lang tag that includes extension subtags

Categories

(Core :: Internationalization, defect, P3)

defect

Tracking

()

People

(Reporter: jfkthame, Unassigned)

References

Details

This led to incorrect font prefs usage in bug 1618034, because Google Translate serves pages with tags like lang=en-x-mtfrom-it; the presence of the private extension subtag caused Locale() construction to fail, and resulted in using x-unicode font prefs instead of x-western.

(When this is fixed properly, we should remove the hack introduced by bug 1618034 to strip -x- subtags in nsLanguageAtomService::GetUncachedLanguageGroup.)

We have two paths forward:

  1. Use Locale from unic-locale to back MozLocale
  2. Handle parsing locale identifier into LanguageIdentifier by stopping at the first -x-, -t- or -u- and ignoring the rest

I think I'd prefer to start with (2), and extend to (1) if we need to support extensions in Gecko.

Priority: -- → P3

The severity field is not set for this bug.
:m_kato, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(m_kato)
Severity: -- → S3
Flags: needinfo?(m_kato)
You need to log in before you can comment on or make changes to this bug.