synacor / preact-i18n

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

Add CLDR pluralization options #56

Closed msfstef closed 3 years ago

msfstef commented 3 years ago

I have been using Phrase to manage my app translations and they seem to use the CLDR Plural Rules, which have "zero", "one" and "other" as the plural form keys.

It would be nice to include these as well as it doesn't affect the rest of the library and only broadens the support with little overhead.

billneff79 commented 3 years ago

Thanks for the contribution @msfstef . Seems reasonable. I have a couple of comments and then we'll get this merged.

billneff79 commented 3 years ago
msfstef commented 3 years ago

Fixed conditional and added some test cases.

I currently use preact-X in my project, but figured I'd make this request to master first. Should I subsequently make a PR to preact-X, or do you update both in sync?

Thank you

billneff79 commented 3 years ago

This looks great. It should be a pretty straight merge to the preact-x branch. I'll take care of that and get a release out for both branches. Thanks for the commit!