ZF-6877: Zend_Form_Decorator_FormErrors does not use I18n on label
Description
Forms with a translator do not translate element labels in the list of form errors. I believe the problem exists in Zend_Form_Decorator_FormErrors::renderLabel. Following a similar pattern to Zend_Form_Decorator_Label, the following patch should provide the functionality (patch against trunk r15870):
Index: library/Zend/Form/Decorator/FormErrors.php
--- library/Zend/Form/Decorator/FormErrors.php (revision 15870) +++ library/Zend/Form/Decorator/FormErrors.php (working copy) @@ -351,6 +351,10 @@ $label = $element->getName(); }
- if (null !== ($translator = $element->getTranslator())) {
- $label = $translator->translate($label);
- }
- return $this->getMarkupElementLabelStart() . $view->escape($label) . $this->getMarkupElementLabelEnd();
Thanks
Comments
Posted by Steve Lounsbury (stephenminded) on 2009-06-01T12:11:22.000+0000
Sorry, patch doesn't seem to come out that well. I can provide a file if needed.
Posted by Harro van der Klauw (oximoron) on 2009-06-13T10:19:34.000+0000
Hey Steve, There is an attach file function for issues.
Please use that to attach the patch.
Posted by Steve Lounsbury (stephenminded) on 2009-06-13T15:36:19.000+0000
Diff attached. Sorry, I didn't see the "attach a file" link at first.
Posted by Thomas Weidner (thomas) on 2009-11-13T12:11:23.000+0000
Given patch not correct. Fixed with r18965.