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)    

 [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)


 [2006-03-08 11:31 UTC] bate
This patch solves the bug for me.
 [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 by the end of next Sunday (CET). If this was a problem with the 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.