1

It's always getting "5 clicks" on the screen. The React Intl documentation is so poor and so bad API design. How come this would give us '5 clicks' as always.

Any other i18n lib recommended for React?

<IntlProvider locale={locale} messages={messages} defaultLocale="en-US">
            <FormattedPlural value={0} zero="no click" one="1 click" other="5 clicks" />
<IntlProvider/>
newBike
  • 14,385
  • 29
  • 109
  • 192

1 Answers1

0

This could be due to the fact that FormattedPlural identifies the cardinals based on the locale and for english or the one that you are giving the available cardinals might be "one" and "other". So it's would mean that you would never see what you specified in "zero". If the value is {1} you would see "1 click" and any other value will give "5 click".

you can refer this page to identify what to expect from different locales: https://unicode-org.github.io/cldr-staging/charts/latest/supplemental/language_plural_rules.html