Closed nornagon closed 2 years ago
Hi @nornagon,
Thanks for this issue! This one is pretty tricky though...
I fear to understand now that I falsely assumed that the count
discriminator would also be a good replacement for %1
in the strings.
You mean that:
i18n.ngettext('There is %1 apple', 'There are %1 apples', 1);
should return (in EN_US) "There is %1 apple"
, while
i18n.ngettext('There is %1 apple', 'There are %1 apples', 1, 1);
should return (in EN_US) "There is 1 apple"
If so, it would be a huge BC break for gettext.js :(
I'll double check the GNU implementation before considering this important change, and then update the test suite and the major version bump.
Best
Yep, you've understood the situation as I do. I checked the GNU implementation too and found that gettext.js's behavior is different.
This messes up the indices for strings which don't expect the number to be the first index.
e.g.
n
should be used to determine the plural form, but not also take the first argument slot.