Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.11.4

Bug #7060 2nd call to setLocale fails with fallbackLocale
Submitted: 2006-03-08 11:29 UTC
From: bate Assigned: mike
Status: Closed Package: I18Nv2 (version CVS)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2006-03-08 11:29 UTC] bate (Marco Kaiser)
Description: ------------ if i call setLocale twice or more just the first call returns true this is not correct in the case that a fallback lang will match my locale my example below is for FreeBsd related locale. Test script: --------------- <?php require_once 'I18Nv2.php'; $fallbacks = &I18Nv2::getStaticProperty('fallbacks'); $fallbacks = array( 'test' => 'de_DE.ISO8859-15', ); var_dump(I18Nv2::setLocale('test')); var_dump(I18Nv2::setLocale('test')); Expected result: ---------------- string(16) "de_DE.ISO8859-15" string(16) "de_DE.ISO8859-15" Actual result: -------------- string(16) "de_DE.ISO8859-15" bool(false)

Comments

 [2006-03-08 11:31 UTC] bate
This patch solves the bug for me. http://bate.de/pear/7060_I18Nv2.php.txt
 [2006-03-08 12:42 UTC] mike
Though you should not overwrite these fallbacks, I can verify that behaviour. If at least use something like $fallbacks["test"] = "..."; do that other fallbacks retain.
 [2006-03-08 12:59 UTC] mike
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.