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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri Mar 29 01:01:28 2024 UTC