ZF-2255: Locale is over written with Automatic source detection
Description
When we use Automatic source detection we are loosing the value of $locale set in the constructor. This appends because the same $locale variable is reuse to add the translation file with ::addTranslation().
So at the end of the directory scanning when the locale is set, $locale have the value of the last added file :
if ((array_key_exists($locale, $this->_translate)) and (count($this->_translate[$locale]) > 0)) {
$this->setLocale($locale);
}
Comments
Posted by Thomas Weidner (thomas) on 2007-12-03T13:00:39.000+0000
When you are using "automatic detection", any set locale is useless because the automatic detection will overwrite it.
Zend_Locale will in this case automatically search for the right locale. This is forced within the setLocale() method of the translation instance.
Posted by Laurent Melmoux (laurent melmoux) on 2007-12-03T13:47:02.000+0000
Oh, In fact I mean automatic detection of the source files not the locale :)
Posted by Thomas Weidner (thomas) on 2007-12-15T15:42:02.000+0000
Fixed with SVN-7143