Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: 1.8.1
-
Fix Version/s: None
-
Component/s: Zend_Form
-
Labels:None
-
Tags:
Description
the getLabel() method of Zend_Form_Element does not perform translation as described in the doc (http://framework.zend.com/manual/en/zend.form.i18n.html#zend.form.i18n.standard)
It seems that there is no translator returned in the label decorator for file elements. The method called is Zend_Form_Element_File::getTranslator() which in the end is calling Zend_File_Transfer_Adapter_Abstract::getTranslator()
The code in Zend_File_Transfer_Adapter_Abstract does not return the default translator if there is not a specific one assigned. Replacing the code in Zend_File_Transfer_Adapter_Abstract::getTranslator() with the below (from Zend_Form_Element::getTranslator()) fixes the problem and make sure the default translators is returned.
if ($this->translatorIsDisabled()) { return null; }
if (null === $this->_translator) { require_once 'Zend/Form.php'; return Zend_Form::getDefaultTranslator(); }
return $this->_translator;