Issues

ZF-11332: Double translation of form element's label

Issue Type: Bug Created: 2011-04-29T08:17:21.000+0000 Last Updated: 2011-12-01T12:16:22.000+0000 Status: Closed Fix version(s): Reporter: Alex (lexor) Assignee: Christian Albrecht (alab) Tags: - Zend_Form

Related issues: - ZF-8694

Attachments:

Description

There is a method Zend_Form_Decorator_Label

<pre class="highlight">
    public function getLabel()
    {
        if (null === ($element = $this->getElement())) {
            return '';
        }

        $label = $element->getLabel();
        $label = trim($label);

        if (empty($label)) {
            return '';
        }

        if (null !== ($translator = $element->getTranslator())) {
            $label = $translator->translate($label);
        }

When

<pre class="highlight"> is called the element asks his translator to translate the label. But this is also done by

a bit later. We have two calls to translator instead of one.

Comments

Posted by Kai Uwe (kaiuwe) on 2011-04-29T10:57:59.000+0000

@Alex Please use always the search function before create a new ticket. Thanks.

Posted by Alex (lexor) on 2011-04-29T11:03:54.000+0000

I did search but got no relevant results by the keyword I entered... Glad to hear you have already put the issue into task queue.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts