-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
StringUtil::singularify() does not convert "movies" correctly #14189
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
Comments
Reopened the PR, the first one was accidentally set for 2.7 instead of 2.3. |
@GerbenWijnja thanks for fixing this error. However, as I always do when someone reports a problem with the "magic Symfony pluralizator", I'll say it again: I think it's a big mistake to have this code inside Symfony. It's really hard to take into account the myriad of English irregularities and it can interfere with languages different from English. In addition, whenever we add more lines of code to fix these exceptions, we complicate the code of Symfony and (very very very slightly) degrade its performance. |
@javiereguiluz I think that the core team have understood your opinion on this class. It doesn't make sense to repeat it again and again. @GerbenWijnja thank you for submitting a PR! If you know you're going to submit a PR, you don't have to create an issue. Issues are a way to discuss new features or to explain the problem, and let someone else fix it. |
I agree with @javiereguiluz. We can't possibly account for every case and exception. We need to find a solution though. Perhaps a solution would be to provide end users with a way to either map words or define rules themselves. |
I've mentioned it a couple of times already during these discussions. But imo, we should keep using the StringUtil class, but also support the syntax proposed in this PR: #3819 This would mean that in this case, one can set |
…jnja) This PR was merged into the 2.3 branch. Discussion ---------- [StringUtil] Fixed singularification of 'movies' | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #14189 | License | MIT | Doc PR | n/a The word 'movies' was singularified to 'movy'. There seem to be only two words ending in 'ovies', which are 'movies' and 'anchovies'. The singular of the latter is 'anchovy'. All other words ending in 'vies' singularify to 'vy', so the word 'movies' is an exception to the general rule. Commits ------- 6f5e95b [StringUtil] Fixed singularification of 'movies'
The plural map contains:
And as a result, movies is singularified to movy. Symfony is now looking for 'addMovy' and 'removeMovy' instead of 'addMovie' and 'removeMovie'.
(Is there a possibility to hint for function names by the way?)
The word 'movies' seems to be an exception to the general rule. I checked a couple of word sites and there are only 2 words ending in 'ovies': movies and anchovies. The singular of the latter is anchovy. All other words ending in "vies" should be singularified to "vy", as far as I can tell. This would result in an exception for just the word 'movies'.
Putting this in front of the 'babies' entry solves the issue:
Added a pull request, my very very first pull request on GitHub. Hope I did everything right.
The text was updated successfully, but these errors were encountered: