8000 [String][EnglishInflector] Plural/Singular of the word alias is wrong · Issue #57524 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[String][EnglishInflector] Plural/Singular of the word alias is wrong #57524

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
dheineman opened this issue Jun 25, 2024 · 1 comment
Closed

Comments

@dheineman
Copy link

Symfony version(s) affected

5.4 +

Description

When using the EnglishInflector of the String component to pluralize the word alias it returns aliass which is wrong.

Alias seems to be usable as both a noun and an adverb.

  • in the case of a noun the plural is aliases
  • in the case of an adverb it is just alias.

I am not an expert in the English language so I am not sure what the preferred solution would be in cases like this but If alias is to be treated as plural by the inflector then the singular of the word would be incorrect as alias becomes alia.

references:

How to reproduce

// In an empty directory, run "composer require symfony/symfony:5.4.x-dev"
// Then, execute this code:
<?php
require_once __DIR__.'/vendor/autoload.php';
use Symfony\Component\String\Inflector\EnglishInflector;

// if alias it singular then the inflector
// returns "aliass" instead of "aliases" or "alias" when pluralizing
var_dump((new EnglishInflector())->pluralize('alias'));

// if alias is plural then the inflector
// returns "alia" instead of "alias" when singularizing
var_dump((new EnglishInflector())->singularize('alias'));

Possible Solution

An extra pluralize/singularize rule can be added to ensure the correct result or alias be added to the list of "uninflected" words.

Additional Context

No response

@alexandre-daubois
Copy link
Member

Alias seems to be usable as both a noun and an adverb.

I think that it is very unlikely to have "alias" as an adverb when using the Inflector, so I guess the rule can be added to pluralize to "aliases"

7436 nicolas-grekas added a commit that referenced this issue Jun 28, 2024
…-daubois)

This PR was merged into the 5.4 branch.

Discussion
----------

[String] Add `alias` case to `EnglishInflector`

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

Commits
-------

5468d38 [String] Add `alias` case to `EnglishInflector`
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

4 participants
0