synacor / preact-i18n

Simple localization for Preact.
BSD 3-Clause "New" or "Revised" License
206 stars 18 forks source link

Pluralization for more languages #2

Open codepunkt opened 7 years ago

codepunkt commented 7 years ago

At the moment, only none, one and many are available. Are there any plans to allow pluralization for languages such as Czech?

See http://www.unicode.org/cldr/charts/29/supplemental/language_plural_rules.html for reference.

developit commented 7 years ago

Yes! They are aliases and you can actually also use an Array or numeric keys to customize per-number. The thing we don't yet support is custom ranges. We'd love a PR exploring it!

developit commented 7 years ago

FWIW someone mentioned on Twitter that it might be worth investigating ICU Message format, as react-intl uses. For our case this was deemed too large given the set of languages we support, but I'd love to have the ability to inject ICU support via a plugin model. The definitions are still just strings, but given an ICU plugin they could be extended to be full message templates.

yaitskov commented 5 years ago

Russian and Polish languages are also requiring this.