Issues

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

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.

Oh, In fact I mean automatic detection of the source files not the locale :)

Fixed with SVN-7143