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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: m dot voelker at crew-united dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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 Nov 06 22:01:29 2024 UTC