Skip to content
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

Supports common verbs? #98

Open
vincentaudebert opened this issue Apr 11, 2018 · 2 comments
Open

Supports common verbs? #98

vincentaudebert opened this issue Apr 11, 2018 · 2 comments

Comments

@vincentaudebert
Copy link

I'm just facing a situation where I use pluralize to pluralize a noun (membership/memberships) but then the following word is a verb (is/are) and I will have to modify it by hands.

What about supporting common verbs like to be to have to do ?
Could look like

pluralize(
      'to be',
      count,
      false
    );

?

Maybe add the extra function in the package? pluralize_verb? or an argument to specify it's a verb?

@blakeembrey
Copy link
Collaborator

Possibly related to #25. It's a tricky problem and I thought about it before, but I couldn't think of much reason to have this automated. I would have thought it'd be easier to use an i18n library that switches on numbers, or some other templated approach. Can you share more about how you'd like to see a library automatically work with verbs?

@ahamid
Copy link

ahamid commented May 16, 2019

Just ran into a similar case, first tried to see if by any chance it was handled already, but perhaps something naive would suffice for many cases:

const inverse = n => (n - 1) ? 1 : 2
let count = 5
const msg = pluralize('record', count, true)   ' '   pluralize('exist', inverse(count))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants