Closed Bug 1344141 Opened 3 years ago Closed 3 years ago
Nightly l10n build for ja-JP returns locale string that's not "ja-JP"
59 bytes, text/x-review-board-request
When I tested the date picker UI on nightly builds for different locales, the locale string returned from the JP version for mac is "ja-JP-mac" with chrome-registry, or "ja-JP-x-lvariant-mac" with localeservice. This causes an invalid language tag error if used with getCalendarInfo (bug 1287503).  https://ftp.mozilla.org/pub/firefox/nightly/latest-mozilla-central-l10n/firefox-54.0a1.ja-JP-mac.mac.dmg  Components.classes["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIXULChromeRegistry).getSelectedLocale("global");  Components.classes["@mozilla.org/intl/localeservice;1"].getService(Components.interfaces.mozILocaleService).getAppLocale();
Yeah, ja-JP-mac is a locale code we use in practice, and sadly it's violating specs. We need special casing in parts where we need to pass our locale code to libraries that validate the locale code.
Assignee: nobody → gandalf
Status: NEW → ASSIGNED
Not sure if it's related, but when I built ja-JP-mac langpack and installed it (and switched to ja-JP-mac), the LocaleService is still returning 'en-US' for me. Investigating.
OK, so the langpacks is a different bug, but this is fortunately trivial to fix. We just need not to canonicalized the language from chrome registry. Patch coming.
And the langpack bug moved to bug 1344355.
Comment on attachment 8843473 [details] Bug 1344141 - Do not BCP47 canonicalize languages from ChromeRegistry in LocaleService. https://reviewboard.mozilla.org/r/117206/#review119300 I guess this is fine for now. I'd be really happy if we eventually found ourselves using canonical locale tags everywhere, but that's a bigger issue...
Attachment #8843473 - Flags: review?(jfkthame) → review+
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/e3c420b74eb9 Do not BCP47 canonicalize languages from ChromeRegistry in LocaleService. r=jfkthame
Comment on attachment 8843473 [details] Bug 1344141 - Do not BCP47 canonicalize languages from ChromeRegistry in LocaleService. Approval Request Comment [Feature/Bug causing the regression]: bug 1332207 [User impact if declined]: some date/times will be formatted in en-US when using ja-JP-mac locale [Is this code covered by automated tests?]: nope [Has the fix been verified in Nightly?]: yes [Needs manual test from QE? If yes, steps to reproduce]: no [List of other uplifts needed for the feature/fix]: none [Is the change risky?]: no [Why is the change risky/not risky?]: because it's a single boolean flag change that has been tested on nightly and at most affects one locale [String changes made/needed]: none
Attachment #8843473 - Flags: approval-mozilla-aurora?
Comment on attachment 8843473 [details] Bug 1344141 - Do not BCP47 canonicalize languages from ChromeRegistry in LocaleService. Fix a date/times format with ja-JP-mac locale issue. Aurora54+.
Attachment #8843473 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.