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

Fix: using singular for zero quantity #2

Closed
wants to merge 1 commit into from

Conversation

TomFevrier
Copy link

Simple fix so that the library doesn't pluralize the noun when the quantity is 0, because it doesn't make sense.

@TomFevrier
Copy link
Author

Note: if we wanted to handle negative numbers as well, we could do Math.abs(qty[0]) <= 1.

@broofa
Copy link
Owner

broofa commented Nov 20, 2022

Salut Tom, merci pour ta contribution ici!

[And that's pretty much the limit of my French, I'm afraid 😄 ]

it doesn't make sense.

It does, for English. But for other languages... yeah, not so much. I.e. At a minimum, we need to preserve the current behavior for English speaking users. Or, at least, continue to offer the current behavior somehow. Simply changing it to work for French while breaking it for English is not an option.

And if we're going to add support for another language, I want to do that in a way that works for as many languages as possible. I.e. I would prefer to properly internationalize this code. To that end, I've opened issue #3 where I outline my current thoughts on that broader problem.

If you're up for it, I'd appreciate your help in figuring out how to do that work. Maybe start by giving me your thoughts on the problem, and describe what solution you're thinking of in broad strokes before diving into code? That will probably save us both some time / effort.

In the meantime I'm going to close this PR out. We can reopen or open a new PR once we've got a more viable solution.

@broofa broofa closed this Nov 20, 2022
@TomFevrier
Copy link
Author

Salut Tom, merci pour ta contribution ici!

[And that's pretty much the limit of my French, I'm afraid smile ]

it doesn't make sense.

It does, for English. But for other languages... yeah, not so much. I.e. At a minimum, we need to preserve the current behavior for English speaking users. Or, at least, continue to offer the current behavior somehow. Simply changing it to work for French while breaking it for English is not an option.

And if we're going to add support for another language, I want to do that in a way that works for as many languages as possible. I.e. I would prefer to properly internationalize this code. To that end, I've opened issue #3 where I outline my current thoughts on that broader problem.

If you're up for it, I'd appreciate your help in figuring out how to do that work. Maybe start by giving me your thoughts on the problem, and describe what solution you're thinking of in broad strokes before diving into code? That will probably save us both some time / effort.

In the meantime I'm going to close this PR out. We can reopen or open a new PR once we've got a more viable solution.

I didn't know zero was plural in English... People say French is weird, but English can be pretty counter-intuitive as well!
I get your point, in the meantime I ended up using another solution.

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

Successfully merging this pull request may close these issues.

2 participants