eemeli / intl-pluralrules

Polyfill for Intl.PluralRules
https://www.npmjs.com/package/intl-pluralrules
ISC License
41 stars 7 forks source link

Wrong "style" prop in "options" regarding to spec #1

Closed ixrock closed 6 years ago

ixrock commented 6 years ago

Regarding to specification: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/PluralRules second argument options defines type, not style as in your implementation for "cardinal" or "ordinal" values.

e.g. should be new Intl.PluralRules("en-US", {type: "ordinal"})

Please fix this small issue and thank you for polyfill!

eemeli commented 6 years ago

The fix is now in the master branch, but it looks like my dev dependencies are full of "*" and the build system still uses make, so I'll need to port the whole thing to something more modern to make sense of it and fix the output. I'd happy to accept a PR for that; it might take me some number of days to get this fixed.

eemeli commented 6 years ago

s/number of days/number of hours/

v0.2.0 is now available on npm.

ixrock commented 6 years ago

Great! But now import is totally broken for me :)

0] ERROR in ./node_modules/intl-pluralrules/plural-rules.js
[0] Module not found: Error: Can't resolve 'make-plural/umd/pluralCategories' in './node_modules/intl-pluralrules'
[0]  @ ./node_modules/intl-pluralrules/plural-rules.js 15:24-67
[0]  @ ./node_modules/intl-pluralrules/polyfill.js
[0]  @ ./client/i18n/i18n.ts
[0]  @ ./client/i18n/index.ts
[0]  @ ./client/components/app.tsx
...
eemeli commented 6 years ago

@ixrock Oops, sorry, I'd left make-plural as a dev dependency. Try again with 0.2.1?

ixrock commented 6 years ago

@eemeli Now it works perfect! Many thanks :)