alibaba / react-intl-universal

Internationalize React apps. Not only for Component but also for Vanilla JS.
1.33k stars 154 forks source link

ICU standards for numbers formatting works partially #175

Open BigBadAlien opened 2 years ago

BigBadAlien commented 2 years ago

As described in the readme:

Message format is strictly implemented by ICU standards.

But I tested the number formatting from here:

https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html

and most of the examples don't work, such as:

{value, number, ::.####}

or

.00/w

But

{value, number, ::.0####}

works

BigBadAlien commented 2 years ago

Looks like the bug in another package. Created https://github.com/formatjs/formatjs/issues/3193

BigBadAlien commented 2 years ago

To resolve the issue require an update intl-messageformat to 9.9.3

cwtuan commented 2 years ago

intl-messageformat@9.9.3 would breaks the test cases. I will take time to fix it.

BigBadAlien commented 1 year ago

Any plans to update intl-messageformat to the last version? A lot of helpful skeletons there like integer-width, scale, etc... Also, the current version looks really ancient (7.8.4 compare to 10.2.5)

cwtuan commented 1 year ago

Thanks for reporting this issue. Since theintl-messageformat breaks API behavior, we are looking forward some way to solve it. By the way, PR is also welcome.