ZF-4133: addTranslate() overwrites locale

Description

The method addTranslation() in Zend_Translate_Adapter contains a bug at the end of the method which overwrites the previous locale. It checks whether the original locale is set with:

isset($translate[$originate])

However this is never true since the variable $translate does not exist. It should rather be

isset($this->_translate[$originate])

Otherwise when performing a directory scan the locale will be set to the last one found during the scan.

Comments

When performing a directory scan the locale will never be set to the last one if you provide a locale yourself. The testbed would show such a behaviour.

The second clause will be checked anyway. There will only be a notice because of this problem, but no change in the behaviour of this class.

Updating for the 1.6.0 release.