alexanderwallin / node-gettext

A JavaScript implementation of gettext, a localization framework.
Other
188 stars 36 forks source link

Wrong plural form for e.g. Brazilian Portuguese #70

Open susnux opened 1 year ago

susnux commented 1 year ago

The plural form is only looked up by the language part of the locale, e.g. pt for pt_BR. But for Brazilian Portuguese the plural form is different from Portuguese so it should be first checked if there is a plural function for the whole locale and only if not fallback to the language part.

pt_BR: Plural-Forms: nplurals=2; plural=n>1; pt: Plural-Forms: nplurals=2; plural=n != 1;