Closed Maskoe closed 7 months ago
Yep, these should be supported as mentioned in the pluralization docs. Can you provide a reproduction that shows the erroneous behavior? The issue template is typically better suited if a feature doesn't work as expected.
Hi, I tried creating a bug report. Github wont let me.
Here is the repro repo: https://github.com/Maskoe/next-intl-bug-repro-app-router
Oh, I see now—thanks for the repro. I did a quick check previously and found that "one" worked correctly, so I thought it must bug in the app setup.
However, this is in fact working as intended as tags like "zero" and "one" are only supported for languages which have special grammar rules for these cases. In your case, English doesn't have special grammar for "zero" since it has only two plural forms in total (one/other). So for your example you need to use =0
to get special handling in English.
See also:
new Intl.PluralRules("en").select(0); // other
new Intl.PluralRules("lv").select(0); // zero
I've clarified this in the docs now in https://github.com/amannn/next-intl/pull/964.
Thanks for the report, this was an oversight on my side!
Is your feature request related to a problem? Please describe.
I have this message format
You have {count, plural, zero {no followers yet} one {one follower} other {# followers}}.
This produces the following output:You have 0 followers.
I got the syntax from another library that implements ICU. I also saw in the documentation that these tags are supposed to be supported.
It doesnt work for me. Im not sure if this is a bug, or not implemented or if Im just using it wrong.
I am using it via getTranslations in a react server component.
Describe the solution you'd like
I would like to be able to use "zero" and all other tags described in the documentation.
Describe alternatives you've considered
You have {count, plural, =0 {no followers yet} =1{one follower} other {# followers}}.
This syntax works and does the same type of stuff.