Closed Bug 1728180 Opened 2 months ago Closed 26 days ago

Unify js::intl_GetCalendarInfo

Categories

(Core :: Internationalization, task, P3)

task

Tracking

()

RESOLVED FIXED
94 Branch
Tracking Status
firefox94 --- fixed

People

(Reporter: gregtatum, Assigned: anba)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [i18n-unification], [i18n-unification-help-wanted])

Attachments

(2 files)

Work Amount: Small
What it is: Some calls to the ucal APIs. There is already a mozilla::intl::Calendar class.
Searchfox: https://searchfox.org/mozilla-central/rev/5a362eb7d054740dc9d7c82c79a2efbc5f3e4776/js/src/builtin/intl/IntlObject.cpp#75

Whiteboard: [i18n-unification-help-wanted]

Bug 1693576 will add a proper standardised way to expose this functionality. We could either wait until the open issues in the proposal have been resolved and then update callers of intl_GetCalendarInfo to use the new API. Or alternatively land bug 1693576, but only expose it for privileged contexts. Both alternatives ensure we don't spend time unifying code which will be removed soon anyway.

Whiteboard: [i18n-unification-help-wanted] → [i18n-unification], [i18n-unification-help-wanted]

Bug 1693576 will take a bit more time due to open spec issues, but the necessary API to replace ICU calls with mozilla::intl has already landed, so we can make progress on this bug.

Returning an array matches the current "Intl Locale Info API" proposal and
actually also simplifies the single user of this function.

Assignee: nobody → andrebargull
Status: NEW → ASSIGNED

Use mozilla::intl::Calendar instead of directly calling ICU in
intl_GetCalendarInfo. This implies that the days of the week are now ordered
the same way as in the "Intl Locale Info API" and the "Temporal" proposal, i.e.
starting from Monday=1 to Sunday=7.

Depends on D126227

Pushed by andre.bargull@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/a604874baa24
Part 1: Change "Intl.getCalendarInfo" to return an array of weekend days. r=platform-i18n-reviewers,dminor
https://hg.mozilla.org/integration/autoland/rev/79f2d028ab51
Part 2: Call mozilla::intl::Calendar methods in intl_GetCalendarInfo. r=platform-i18n-reviewers,dminor
Status: ASSIGNED → RESOLVED
Closed: 26 days ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch
You need to log in before you can comment on or make changes to this bug.