|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-02-12 14:47 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: cmb
[2021-02-12 14:47 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 02:00:01 2025 UTC |
Description: ------------ The method call \ResourceBundle::getLocales('') from the intl extensions returns a huge array with language codes. The list contains (German names here): 'nb' => 'Norwegisch Bokmål' 'nb_NO' => 'Norwegisch Bokmål (Norwegen)' 'nb_SJ' => 'Norwegisch Bokmål (Spitzbergen und Jan Mayen)' 'nn' => 'Norwegisch Nynorsk' 'nn_NO' => 'Norwegisch Nynorsk (Norwegen)' but *NOT* the main key 'no' => 'Norwegisch' Using 'no' however works and translates (to 'Norwegisch') without a problem. Problem occurs on Windows and Linux with all current php versions (7.1, 7.2, 7.3, 7.4RC1). Test script: --------------- a) With intl extension NOT enabled Windows shell / cmd: php -dextension=php_intl.dll -r "var_dump(\ResourceBundle::getLocales(''));" | find "no" Linux: php -dextension=intl.so -r "var_dump(\ResourceBundle::getLocales(''));" | grep no b) With intl extension enabled Windows shell / cmd: php -r "var_dump(\ResourceBundle::getLocales(''));" | find "no" Linux: php -r "var_dump(\ResourceBundle::getLocales(''));" | grep no Expected result: ---------------- 'no' should be a key in the array returned by: \ResourceBundle::getLocales('') Test scripts (above) should output the 'no' key. Actual result: -------------- Key does not exist in array returned by: \ResourceBundle::getLocales('')