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

[String] do not add an extra s at the end if last character is s #52803

Closed
wants to merge 0 commits into from
Closed

[String] do not add an extra s at the end if last character is s #52803

wants to merge 0 commits into from

Conversation

k0d3r1s
Copy link
Contributor

@k0d3r1s k0d3r1s commented Nov 29, 2023

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #52800
License MIT

As already written in #52800, settings, for example, already end with s, so assumption to add extra s at the end is incorrect

@OskarStark
Copy link
Contributor

Can you please add a test case to avoid further regressions? Thank you

@acirulis
Copy link

acirulis commented Nov 29, 2023

How about words, such as :
Corps -> corps
Diagnosis -> diagnoses
Ethos -> ethe or ethea or ethoses
Gas -> gases

Current output of Inflector is as follows:

Corpss
Diagnoses # only one correct
Ethoss
Gass

@k0d3r1s
Copy link
Contributor Author

k0d3r1s commented Nov 30, 2023

@OskarStark added tests

+ extra words from comments

@derrabus
Copy link
Member

The inflector is meant to pluralize singular terms. That's its purpose. If the term in question is already a plural, you should not use it. And neither is this class meant to detect or normalize plural forms.

@acirulis
Copy link

@derrabus maybe so but this issue started when Api Platform switched from doctrine/inflector (which does check if plural form is already used) to symfony/string (not sure the reasoning). Please see api-platform/core#5957

@fiburonsk
Copy link

I came across alias it should be aliases but the EnglishInflector generates aliass instead, similar to gas and gases above.

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

Successfully merging this pull request may close these issues.

None yet

6 participants