php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55047 \ResourceBundle misses keys
Submitted: 2011-06-13 19:32 UTC Modified: 2021-11-11 11:15 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: franssen dot roland at gmail dot com Assigned:
Status: Open Package: I18N and L10N related
PHP Version: 5.3.6 OS: Ubuntu 11.04
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: franssen dot roland at gmail dot com
New email:
PHP Version: OS:

 

 [2011-06-13 19:32 UTC] franssen dot roland at gmail dot com
Description:
------------
I currently use the \ResourceBundle class from the intl extension. After an upgrade to 5.3.6 some essental keys were missing.

Before i used a ICU4C data library for 3.8.1, after the upgrade i noticed ICU version upgraded too (4.4.1). Using \ResourceBundle with the new data library results in unknown keys, downgrading the data library resolves it.

Created the data library at;
http://apps.icu-project.org/datacustom/ICUData38.html
http://apps.icu-project.org/datacustom/ICUData44.html

See also;
http://site.icu-project.org/design/resbund/issues

Test script:
---------------
<?php
$res = new \ResourceBundle('en_US', '/usr/data/icu381', true);
var_dump($res->get('Languages'));
var_dump($res->getErrorMessage());

$res = new \ResourceBundle('en_US', '/usr/data/icu441', true);
var_dump($res->get('Languages'));
var_dump($res->getErrorMessage());

Expected result:
----------------
object(ResourceBundle)
"U_ZERO_ERROR"

object(ResourceBundle)
"U_ZERO_ERROR"

Actual result:
--------------
object(ResourceBundle)
"U_ZERO_ERROR"

NULL
"Cannot load resource element 'Languages': U_MISSING_RESOURCE_ERROR"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-06-13 20:14 UTC] franssen dot roland at gmail dot com
Until ICU4C library 4.2 all keys seem to be available
 [2012-02-21 10:18 UTC] jinmoku at hotmail dot com
With ICU 4+, the Languages key is in another file, you should open it with "/usr/data/icu441/lang" unfortunately it doesn't work
 [2012-06-13 10:22 UTC] jinmoku at hotmail dot com
I think you could used udata_setAppData or udata_setCommonData

http://userguide.icu-project.org/icudata#TOC-ICU-Data-Directory
 [2018-03-12 15:39 UTC] cmb@php.net
-Package: I18N and L10N related +Package: intl
 [2021-11-11 11:15 UTC] nikic@php.net
-Package: intl +Package: I18N and L10N related
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 11:01:30 2024 UTC