Issues

ZF-8247: Zend_Form_Element_File label is not translated

Issue Type: Bug Created: 2009-11-07T17:58:48.000+0000 Last Updated: 2009-11-13T10:20:07.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: Bart Blaszczyk (bartblaszczyk) Assignee: Thomas Weidner (thomas) Tags: - Zend_Form

Related issues: Attachments:

Description

Zend_Form_Element_File label is not translated when the form element is rendered separately.

example:

<pre class="highlight">

// controller
$form = new Zend_Form();
$form->setEnctype('multipart/form-data');
$form->addElement('file', 'myFile', array('label' => 'fileLabel', 'required' => false));
$form->addElement('text', 'myText', array('label' => 'textLabel', 'required' => false));
$form->addElement('submit', 'mySubmit', array('label' => 'submitLabel'));
$this->view->form = $form;

// view
<?= $this->form->renderForm(false) ?>
<?= $this->form->myFile ?>
<?= $this->form->myText ?>
<?= $this->form->mySubmit ?>

"textLabel" and "submitLabel" are correctly translated, "fileLabel" is not translated.

If the form is rendered in such a way:

<pre class="highlight">

// view
<?= $form ?>

then all labels are translated correctly.

Comments

Posted by Bart Blaszczyk (bartblaszczyk) on 2009-11-09T17:28:32.000+0000

It seems that the translator is not set when Zend_Form_Element_File is rendered separately. If I set the translator explicitely (Zend_Form_Element_File::setTranslator()) in the controller before rendering the form, then translation works fine.

Posted by Thomas Weidner (thomas) on 2009-11-13T09:50:38.000+0000

There is no translator set... wether in the form nor within the element. So how should translation work without a translation instance?

I expect missing informations...

Posted by Thomas Weidner (thomas) on 2009-11-13T10:20:06.000+0000

Closing as not reproducable.

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