Bug #55047 [Com]: \ResourceBundle misses keys
Edit report at https://bugs.php.net/bug.php?id=55047&edit=1
ID: 55047
Comment by: jinmoku at hotmail dot com
Reported by: franssen dot roland at gmail dot com
Summary: \ResourceBundle misses keys
Status: Open
Type: Bug
Package: I18N and L10N related
Operating System: Ubuntu 11.04
PHP Version: 5.3.6
Block user comment: N
Private report: N
New Comment:
I think you could used udata_setAppData or udata_setCommonData
http://userguide.icu-project.org/icudata#TOC-ICU-Data-Directory
Previous Comments:
------------------------------------------------------------------------
[2012-02-21 10:18:55] 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
------------------------------------------------------------------------
[2011-06-13 20:14:09] franssen dot roland at gmail dot com
Until ICU4C library 4.2 all keys seem to be available
------------------------------------------------------------------------
[2011-06-13 19:32:53] 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"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55047&edit=1
Thread (4 messages)