php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78528 Norwegian 'no' missing in \ResourceBundle::getLocales('') array
Submitted: 2019-09-12 11:19 UTC Modified: 2021-02-12 14:47 UTC
From: m dot voelker at crew-united dot com Assigned: cmb (profile)
Status: Not a bug Package: intl (PECL)
PHP Version: 7.3.9 OS: Windows + Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
2 + 40 = ?
Subscribe to this entry?

 
 [2019-09-12 11:19 UTC] m dot voelker at crew-united dot com
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('')

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [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
This would be a bug in ICU.  Consider to report to upstream[1].

[1] <http://site.icu-project.org/bugs>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 12:01:29 2024 UTC