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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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

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-2021 The PHP Group
All rights reserved.
Last updated: Tue Apr 13 20:01:23 2021 UTC