Description
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:
- Go to https://crates.io/categories or https://crates.io/keywords/
- 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.