Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.10.0
-
Fix Version/s: 1.10.1
-
Component/s: Zend_Locale
-
Labels:None
Description
When Zend_Locale::setDefault() is called, it internally calls self::_prepareLocale() with the given $locale, which then sets the static self::$_auto variable if it has not already been set. In setting self::$_auto, _prepareLocale() calls Zend_Locale::getDefault(), which returns the value of the PREVIOUS default (the one before setDefault() was called). Since the self::$_auto variable never changes once set, all subsequent calls to _prepapreLocale() will cause the old default to be used should it fall back to "auto". Thus, calling Zend_Locale::setDefault() has no effect on the default when "auto" is used.
Here's some reproduction code.
Output I get (on Mac OS 10.2.0 with PHP 5.3.1):
Setting locale to: C
Setting default to de_DE
Environment: array(0) {
}
This should be de_DE: en