php-i18n Digest 16 Aug 2010 20:46:11 -0000 Issue 449
Topics (messages 1411 through 1411):
Re: intl / resourcebundle: Invitation to comment
1411 by: Joel Sahleen
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
I am using the Intl ResourceBundle class on a large-scale
internationalization project, and I noticed that when you create a bundle
and then use iteration (i.e., foreach) to loop through the entries, there is
no fallback if entries are missing.
I have one bundle for en_US that is empty, and have put all en_US strings in
root, so that the system will always fall back to US English. If I use the
bundle's get Method the fallback works fine, but the following code returns
null:
$bundle = new ResourceBundle('en_US', 'path/to/bundle/dir', TRUE);
foreach($bundle as $token => $value){
echo $bundle[$token] . "\n"; // always returns null if bundle is empty;
does not fallback to root
}
I'm not sure if this is a bug or how the class is designed to work, but I
thought I should bring it up.
Thanks.
Joel Sahleen
Software Engineer
Adobe Systems, Inc.
--
View this message in context:
http://old.nabble.com/intl---resourcebundle%3A-Invitation-to-comment-tp26896020p29449192.html
Sent from the Php - Internationalization (i18n) mailing list archive at
Nabble.com.
--- End Message ---