[ja] Word order of date/time is broken in ja build on Windows10 Japanese languages
Categories
(Core :: Internationalization: Localization, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr78 | --- | unaffected |
firefox83 | --- | unaffected |
firefox84 | --- | unaffected |
firefox85 | + | fixed |
People
(Reporter: alice0775, Assigned: dminor)
References
(Regression)
Details
(Keywords: intl, nightly-community, regression)
Attachments
(3 files)
[Tracking Requested - why for this release]: Word order of date/time is broken in ja build
Windows10 Japanese language.
Steps to reproduce:
- Start Nightly85 ja build
- Open Library > Import and Backup > Restore
Steps to reproduce:
- Start Nightly85 ja build
- Open any page (e.g. https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions )
- Ctrl+I Page Info
- See Modified: row
Actual Results:
Nightly85.0a1(Buildid 20201208094500): 水曜日, 09 12月 2020 02:54:10
Expected Results:
Firefox83.0: 2020年12月9日 2:53:15
Regression window:
(though, the good build renders garbled characters, see Bug 1681251)
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=eeee2b548e51eaad256f018fadaf1cc10e55c479&tochange=1a164819adefcdb42bdba8a24976b62ee8d03c80
![]() |
Reporter | |
Comment 1•5 years ago
|
||
![]() |
Reporter | |
Updated•5 years ago
|
![]() |
Reporter | |
Comment 2•5 years ago
|
||
![]() |
Reporter | |
Comment 3•5 years ago
|
||
Evaluate the following js in Browser console
(new Services.intl.DateTimeFormat(undefined, {
dateStyle: "long",
timeStyle: "long",
})).format(new Date("2020-12-08 21:00:05"));
Latest Nightly ja build returns: "火曜日, 08 12月 2020 21:00:05"
Firefox83.0 ja build returns "2020年12月8日 21:00:05"
Comment 4•5 years ago
|
||
The same thing is happening in English. (I'm testing in Thunderbird, but it will be the same.)
What was "8 December 2020, 21:00:05 GMT+13" is now "2020 December 8 21:00:05 GMT+13".
Comment 5•5 years ago
|
||
The regression is caused by the change to how we handle undefined
as a locale
value.
Before bug 1635561, we would run the argument via a helper function that would populate it from regionalPrefsLocales
. Now, we pass the undefined
through expecting the DefaultLocale
in JS Context to pick it up (DefaultLocale
is also set to regionalPrefsLocales
).
The issue is that in case of DateTimeFormat
, when used with dateStyle
/timeStyle
we first call OsPreferences
asking for the best pattern for the style. And we pass the locale based on the argument passed to the constructor.
In case the argument is undefined
, we negotiate it against supportedLocalesOf
, still get nothing, and then call:
osPrefs.getDateTimePattern(
osPrefs.dateTimeFormatStyleLong,
osPrefs.dateTimeFormatStyleLong,
undefined
);
which returns "y MMMM d h:mm:ss a z".
Two ways to fix it that I can see are:
- Fix OSPreferences to use regionalPrefsLocales if the
locales
argument is empty - Fix the MozIntl to do:
class MozDateTimeFormat extends DateTimeFormat {
- constructor(locales, options, ...args) {
+ constructor(locales = Services.locale.regionalPrefsLocales, options, ...args) {
let resolvedLocales = DateTimeFormat.supportedLocalesOf(locales);
The former feels broader, but the latter is easier. Your call Dan.
Updated•5 years ago
|
Assignee | ||
Comment 6•5 years ago
|
||
Thanks for investigating!
Assignee | ||
Comment 7•5 years ago
|
||
Try push for the OSPreferences fix: https://treeherder.mozilla.org/jobs?repo=try&revision=365d1914960b81cb9911cb0fa6fbf68c50520614
Assignee | ||
Comment 8•5 years ago
|
||
Comment 10•5 years ago
|
||
bugherder |
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
Description
•