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
 [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-2020 The PHP Group
All rights reserved.
Last updated: Mon Mar 30 23:01:24 2020 UTC