Skip to content

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

Closed
@dheineman

Description

@dheineman

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions