You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the EnglishInflector of the String component to pluralize words ending with -on the results are mainly wrong because of the follwing rule in the SINGULAR_MAP:
This -on rule is not valid in most of the cases. The rule works for foreign (mainly greek) words. This is an irregular case not a standard.
We can already see 3 other rules for words ending in -pon, -son and -con.
How to reproduce
// First, run "composer require symfony/string"// Then, execute this file:<?phprequire_once __DIR__.'/vendor/autoload.php';
useSymfony\Component\String\Inflector\EnglishInflector;
// returns "butta" instead of "buttons"echo (newEnglishInflector())->pluralize('button');
Possible Solution
I'm not an english native-speaker nor an expert of english grammar but I think that it would be better to have a rule dedicated to the foreign word ending in -on, phenomenon and criterion (and maybe others) + a generic rule for words ending in -on.
Additional Context
No response
The text was updated successfully, but these errors were encountered:
The inflector will never be perfect or complete. We fix such issues whenever someone comes up with a wrong pluralization. Please submit a PR that adds the words that you've found wrongly pluralized to our tests and that fixes the issue.
Symfony version(s) affected
5.4 +
Description
When using the EnglishInflector of the String component to pluralize words ending with -on the results are mainly wrong because of the follwing rule in the SINGULAR_MAP:
This -on rule is not valid in most of the cases. The rule works for foreign (mainly greek) words. This is an irregular case not a standard.
We can already see 3 other rules for words ending in -pon, -son and -con.
How to reproduce
Possible Solution
I'm not an english native-speaker nor an expert of english grammar but I think that it would be better to have a rule dedicated to the foreign word ending in -on, phenomenon and criterion (and maybe others) + a generic rule for words ending in -on.
Additional Context
No response
The text was updated successfully, but these errors were encountered: