ZF-2255: Locale is over written with Automatic source detection

Issue Type: Bug Created: 2007-12-03T10:27:44.000+0000 Last Updated: 2008-02-26T12:56:03.000+0000 Status: Resolved Fix version(s): - 1.0.4 (26/Feb/08)

Reporter: Laurent Melmoux (laurent melmoux) Assignee: Thomas Weidner (thomas) Tags: - Zend_Translate

Related issues: Attachments:


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 :

<pre class="highlight">
if ((array_key_exists($locale, $this->_translate)) and (count($this->_translate[$locale]) > 0)) {


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

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.