You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Examine the pluralization of the word "crate" in crate counts of categories or keywords; all numbers which are between 1000 and 1999 inclusive come with a singular "crate"
Expected behavior
I'm not a native English speaker, but I do believe that 1,382 should come with a plural "crates" and not singular "crate".
Screenshots
Desktop (please complete the following information):
OS: NixOS GNU/Linux, nixpkgs-unstable
Browser: Firefox 82.0.2 (64-bit)
Additional context
I believe the problem comes from the fact that crates.io passes"1,382", "crate" to https://github.com/emberjs/ember-inflector 's pluralize(count, word) function, which internally uses parseFloat(count) !== 1 to determine cases where plural should be used, and parseFloat("1,382") happens to be precisely 1, thus leading to pluralize returning singular.
The "act 2" is was in the issue name because of #513, which is a very similar issue, and I believe the fix for it introduced this issue.
The text was updated successfully, but these errors were encountered:
The problem is that format-num turns the number into a string (with a comma for numbers > 999). On the receiving end of the pluralize function, this string is parsed back into a number using parseFloat, which trips on the comma:
Turbo87
changed the title
Pluralization of crate counts in categories and keywords, act 2
Pluralization of crate counts in categories and keywords is broken
Nov 24, 2020
Describe the bug
Visiting https://crates.io/categories, I see
Algorithms 927 crates
API bindings 1,382 crate
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I'm not a native English speaker, but I do believe that 1,382 should come with a plural "crates" and not singular "crate".
Screenshots
Desktop (please complete the following information):
Additional context
I believe the problem comes from the fact that crates.io passes
"1,382", "crate"
to https://github.com/emberjs/ember-inflector 'spluralize(count, word)
function, which internally usesparseFloat(count) !== 1
to determine cases where plural should be used, andparseFloat("1,382")
happens to be precisely1
, thus leading topluralize
returning singular.The "act 2"
iswas in the issue name because of #513, which is a very similar issue, and I believe the fix for it introduced this issue.The text was updated successfully, but these errors were encountered: