Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 1.8.1
-
Fix Version/s: 1.9.0
-
Component/s: Zend_Translate
-
Labels:None
Description
We are running an application on ZF 1.7.4 and I updated the version on our test environment to 1.8.1. I found a difference between these two versions in overwriting translations.
Zend Framework 1.7.4
<?php require_once 'Zend/Translate.php'; $translate = new Zend_Translate('Gettext', 'application/lang/de.mo', 'de'); echo $translate->_('hello'); // hallo welt $translate->addTranslation('module/dummy/lang/de.mo', 'de'); echo $translate->_('hello'); // hallo
Zend Framework 1.8.1
<?php require_once 'Zend/Translate.php'; $translate = new Zend_Translate('Gettext', 'application/lang/de.mo', 'de'); echo $translate->_('hello'); // hallo welt $translate->addTranslation('module/dummy/lang/de.mo', 'de'); echo $translate->_('hello'); // hallo welt
Using the same messageId within several files, and loading them at once leads always to unexpected behaviour. What you will get returned depends on the set cache, the search order and several other informations.