-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move plural types to single npm package #105
Comments
That's not a bad idea. The only thing that's used inside the rest of polyglot is |
I think it's generic enough in what it does. I see it as a module, which exports import getPluralTypeIndex from 'plural-type-index';
const phrases = {
cars: ['car', 'cars'], // plural forms
};
const pluralize = (locale, phrase, count) =>
phrase[getPluralTypeIndex(locale, count)];
pluralize('en', phrases.cars, 1); // car
pluralize('en', phrases.cars, 2); // cars So the purpose of moving code to separate lib is to make it does one thing - get pluralization index |
One thing I would like to add to this if it goes into its own package, I am going to bake it into my application directly for now, eg {
'arabic': 6
'bosnian_serbian': 3,
'chinese': 1,
....
} you get the idea. |
What do you think of moving that part of code to a single package?
Reasons:
The text was updated successfully, but these errors were encountered: