Re:FormatJS – Internationalize your web apps on the client a...
by drewfish on Wednesday October 15, 2014 @02:17AM
(#8457358)
There are a few NPM libraries (make-plural, cldr, probably others) which will help you write those pluralization functions. The CLDR data does get updated from time to time, so it's nice to rely on another package to trace those changes.
Though i18n-js does let you write your own pluralizations rules (taken from the readme), while supporting zero/one/many out of the box:
I've posted an example below, but I don't consider `@div null, @t('welcomeMessage', { username })` "littering" my code.