Issues

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

Sorry, patch doesn't seem to come out that well. I can provide a file if needed.

Hey Steve, There is an attach file function for issues.

Please use that to attach the patch.

Diff attached. Sorry, I didn't see the "attach a file" link at first.

Given patch not correct. Fixed with r18965.