-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Intl] Intl does not return region specific language #35309
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
Hi @alexander-schranz, that's correct and intended from my side :) We excluded locales (or localized languages / or region specific languages) from the dedicated list of "language codes", which is ISO standard and shouldnt include locales but only pure language codes. From the example code, it seems you are using the deprecated API in 4.4. Indeed, this lead to the exception case as both the old and new API read from the same data source. For the new API, localized language names can be obtained using symfony/src/Symfony/Component/Intl/Languages.php Lines 53 to 59 in 7e1a7b7
:} |
Alternatively, to fix the legacy API in 4.4, we could check the
so similar like the new API in 4.4: symfony/src/Symfony/Component/Intl/Languages.php Lines 59 to 74 in 7e1a7b7
i agree we effectively broke the old API as of 4.4, as these indices became unavailable: symfony/src/Symfony/Component/Intl/ResourceBundle/LanguageBundle.php Lines 45 to 52 in 7e1a7b7
but im not sure sure it's worth fixing :) |
@ro0NL Thank you for your fast response.
Think if I did understand the code correctly I can replace |
language codes and locales are 2 independent lists, that's why we excluded locales from language codes in #33148 you should replace the old API with the new API as of 4.3, and then all is good :) |
@alexander-schranz how did you get the exception actually?
this is a bugfix :)
this is a side effect |
@ro0NL its catched so don't worry the exception is not thrown out just did debug and saw that it always landed in the catched case. symfony/src/Symfony/Component/Intl/ResourceBundle/LanguageBundle.php Lines 50 to 51 in 7e1a7b7
|
ah, i see what you mean now :) i think we can close then. The bugfix/change was intended. |
@ro0NL sure. Thank you for the clarification. |
Symfony version(s) affected: >= 4.4.0 (4.3.9 works)
Description
The
Intl::getLanguageBundle()->getLanguageName('de, 'AT', 'en');
does not longer return the region specific language. ExpectedAustrian German
gotGerman
same foren
,GB
expectBritish English
gotEnglish
.also
getLanguages
seems not longer containAustrian German
and the other region specific values.How to reproduce
Additional context
Think it has something todo with @ro0NL changes in #33148 I always landing in the exception case with
The text was updated successfully, but these errors were encountered: