Closed Bug 2101482 Opened 1 day ago Closed 1 day ago

Correct Fluent functions with invalid parameters (`maxFractionalUnits` in `NUMBER()`, `hour12` in `DATETIME()`)

Categories

(Firefox :: General, task)

task

Tracking

()

RESOLVED FIXED
164 Branch
Tracking Status
firefox164 --- fixed

People

(Reporter: flod, Assigned: flod)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

Some Fluent messages call NUMBER() with maxFractionalUnits: 2, which is not a valid option. Both the Rust (fluent-bundle) and JavaScript implementations silently ignore unknown options, so these values are formatted with the default of up to 3 fraction digits instead of the intended 2.

Filing here since this happens in both devtools and browser.

On second thoughts, since this needs code changes and review from code owners, moving to Firefox::General.

Component: Internationalization: Localization → General
Product: Core → Firefox
Summary: Replace the invalid `maxFractionalUnits` option in `NUMBER()` calls → Correct Fluent functions with invalid parameters (`maxFractionalUnits` in `NUMBER()`, `hour12` in `DATETIME()`)
Blocks: 2101489

maxFractionalUnits isn't a NUMBER() option, so it was silently ignored and
values were formatted with up to 3 decimals instead of 2. It's replaced with
maximumFractionDigits.

Similarly, hour12 isn't a supported DATETIME() option, so about:unloads
timestamps used the locale's default hour cycle instead of a 24-hour clock.
It's replaced with hourCycle: "h23".

The migration fixes both options in existing translations too.

Pushed by flodolo@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/73c2a712c7a7 https://hg.mozilla.org/integration/autoland/rev/bf01e023fb26 Replace invalid NUMBER() and DATETIME() options. r=profiler-reviewers,sclements,canova
Status: NEW → RESOLVED
Closed: 1 day ago
Resolution: --- → FIXED
Target Milestone: --- → 164 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: