Description
Symfony version(s) affected
5.4+
Description
The function getNames in the Intl Languages class states: "Gets the list of language names indexed with alpha2 codes as keys."
However it returns the list of alpha2 languages supplemented with alpha3 languages for which no alpha2 code is available. I think this is due to this change: #33140
This change causes a problem where other code expects to get an alpha2 code, but instead receives an alpha3 code. There seems to be no simple way to exclude the alpha3 codes as there is a getAlpha3Names function, but no getAlpha2Names function.
This also impacts the Symfony Form LanguageType, which uses the getNames function to build the language list. It's docs also specify alpha2 being used.
How to reproduce
var_dump(\Symfony\Component\Intl\Languages::getNames());
This shows key values of 3 letters instead of 2, for example ada for Adangme
Possible Solution
No response
Additional Context
No response