8000 EnglishInflector incorrectly pluralizes "coupon" · Issue #40467 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

EnglishInflector incorrectly pluralizes "coupon" #40467

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

Closed
lexmes opened this issue Mar 15, 2021 · 2 comments
Closed

EnglishInflector incorrectly pluralizes "coupon" #40467

lexmes opened this issue Mar 15, 2021 · 2 comments

Comments

@lexmes
Copy link
lexmes commented Mar 15, 2021

Symfony version(s) affected: 5.1.2

Description
The Symfony\Component\String\Inflector\EnglishInflector incorrectly pluralizes the string "coupon" to "coupa". English is not my first language and i've never heard the word "coupa" before. I've searched for the plural version of coupon and didn't find "coupa" anywhere.

How to reproduce
With these two lines the problem should be reproducable:

$inflector = new EnglishInflector();
$plural = $inflector->pluralize( "coupon" )[ 0 ];
echo $plural; // echoes "coupa"

Additional context
symfony/string 5.1.2

@lexmes lexmes added the Bug label Mar 15, 2021
@lexmes lexmes changed the title EnglishInflector incorrecltly pluralizes "coupon" EnglishInflector incorrectly pluralizes "coupon" Mar 15, 2021
nicolas-grekas added a commit that referenced this issue Mar 17, 2021
This PR was merged into the 4.4 branch.

Discussion
----------

[Inflector][String] Fixed pluralize "coupon"

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #40467
| License       | MIT
| Doc PR        |

The rule for "bacteria (bacterium), criteria (criterion), phenomena (phenomenon)" is producing this behaviour. I added an exception to the "criterion exception".

"coupon" is an old French word, that is maybe why it does not follow the classic "on" rule... I dont know. The test passes and I dont think I've added any side-effects.

This is also my first time working with the `EnglishInflector`.

Commits
-------

d3412e9 [Inflector] Fixed pluralize "coupon"
@Nyholm
Copy link
Member
Nyholm commented Mar 18, 2021

Thank you @lexmes.

This bug has been patched in 4.4 and will be merged up to 5.2 and 5.x to be released in the next patch version. Note that 5.1 is EOL and will not be updated.

@lexmes
Copy link
Author
lexmes commented Mar 18, 2021

Thank you @Nyholm for the quick fix! 👍

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

6 participants
0