Closed Bug 1695937 Opened 3 years ago Closed 3 years ago

Add intl::NumberFormat and use it to format numbers in Fluent

Categories

(Core :: Internationalization, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: dminor, Assigned: dminor)

References

(Blocks 1 open bug)

Details

(Whiteboard: [i18n-unification])

Attachments

(2 files)

This will add an initial NumberFormat implementation to intl/components that has sufficient functionality to support formatting Fluent numbers, and switch Fluent over to using it.

This adds an initial version of NumberFormat that is suitable for use by
Fluent.

The options formatting code is taken from SpiderMonkey and modified to use the
standard c++ library rather than SpiderMonkey specific code. The code
generated MeasureUnitGenerated.h is duplicated here temporarily. Once we can
move SpiderMonkey to using this code, we can update the code generation to
avoid this duplication.

Some simple gtests have been written to make development easier. Full test
coverage is not a goal here, as this code will eventually be covered by running
test262 in SpiderMonkey.

Anba, I think this is ready for you to have another look if you have some time. Thank you!

Flags: needinfo?(andrebargull)
Blocks: 1701695

I'm going to land this with the current reviews. There's follow on work in Bug 1701695, so there will be another chance to have a look at this code.

Flags: needinfo?(andrebargull)
Pushed by dminor@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/232a570d6739
Add intl::NumberFormat to components; r=zbraniecki,tcampbell,jandem
https://hg.mozilla.org/integration/autoland/rev/d17059c999a6
Switch FluentBundle to use intl::NumberFormat; r=zbraniecki,hsivonen,jfkthame
Flags: needinfo?(dminor)
Pushed by dminor@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9d2fed16373f
Add intl::NumberFormat to components; r=zbraniecki,tcampbell,jandem
https://hg.mozilla.org/integration/autoland/rev/a895e219ce93
Switch FluentBundle to use intl::NumberFormat; r=zbraniecki,hsivonen,jfkthame
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
Regressions: 1705363
Blocks: 1719664
Whiteboard: [i18n-unification]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: