php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68377 ISO 639-1 language code 'bh' not supported
Submitted: 2014-11-08 12:22 UTC Modified: 2014-11-08 21:11 UTC
From: a dot schilder at gmx dot de Assigned:
Status: Not a bug Package: intl (PECL)
PHP Version: 5.6.2 OS: Windows 7 Pro
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:
17 - 12 = ?
Subscribe to this entry?

 
 [2014-11-08 12:22 UTC] a dot schilder at gmx dot de
Description:
------------
I tried to get the name for the ISO 639-1 language code 'bh' (Bihari), but this isn't possible, neither with Locale::getDisplayLanguage('bh', 'en') nor with Locale::getDisplayName('bh', 'en'). Instead the code itself is returned.

All other language codes work as expected.

Test script:
---------------
<?php
$iso_639_1 = ['ab', 'aa', 'af', 'ak', 'sq', 'am', 'ar', 'an', 'hy', 'as', 'av', 'ae', 'ay', 'az', 'bm', 'ba', 'eu', 'be', 'bn', 'bh', 'bi', 'bs', 'br', 'bg', 'my', 'ca', 'ch', 'ce', 'ny', 'zh', 'cv', 'kw', 'co', 'cr', 'hr', 'cs', 'da', 'dv', 'nl', 'dz', 'en', 'eo', 'et', 'ee', 'fo', 'fj', 'fi', 'fr', 'ff', 'gl', 'ka', 'de', 'el', 'gn', 'gu', 'ht', 'ha', 'he', 'hz', 'hi', 'ho', 'hu', 'ia', 'id', 'ie', 'ga', 'ig', 'ik', 'io', 'is', 'it', 'iu', 'ja', 'jv', 'kl', 'kn', 'kr', 'ks', 'kk', 'km', 'ki', 'rw', 'ky', 'kv', 'kg', 'ko', 'ku', 'kj', 'la', 'lb', 'lg', 'li', 'ln', 'lo', 'lt', 'lu','lv', 'gv', 'mk', 'mg', 'ms', 'ml', 'mt', 'mi', 'mr', 'mh', 'mn', 'na', 'nv', 'nd', 'ne', 'ng', 'nb', 'nn', 'no', 'ii', 'nr', 'oc', 'oj', 'cu', 'om', 'or', 'os', 'pa', 'pi', 'fa', 'pl', 'ps', 'pt', 'qu', 'rm', 'rn', 'ro', 'ru', 'sa', 'sc', 'sd', 'se', 'sm', 'sg', 'sr', 'gd', 'sn', 'si', 'sk', 'sl', 'so', 'st', 'es', 'su', 'sw', 'ss', 'sv', 'ta', 'te', 'tg', 'th', 'ti', 'bo', 'tk', 'tl', 'tn', 'to', 'tr', 'ts', 'tt', 'tw', 'ty', 'ug', 'uk', 'ur', 'uz', 've', 'vi', 'vo', 'wa', 'cy', 'wo', 'fy', 'xh', 'yi', 'yo', 'za', 'zu'];

foreach ($iso_639_1 as $locale) {
    echo Locale::getDisplayLanguage($locale, 'en') . "\r\n";
}

Expected result:
----------------
...
Bihari
...

Actual result:
--------------
...
bh
...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-11-08 21:07 UTC] stas@php.net
The data comes from the ICU library, so I would recommend upgrading your ICU library. If the newest library still does not support 'bh' then it should be reported upstream to http://site.icu-project.org/ - intl extension is just a wrapped for ICU, we do not keep our own data for intl.
 [2014-11-08 21:11 UTC] stas@php.net
-Status: Open +Status: Not a bug
 [2014-11-08 21:11 UTC] stas@php.net
Closing as ICU issue.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 02:01:29 2024 UTC