ZF-4985: Zend_Form_Element_File does not translate error message when translator is set at the form level

Issue Type: Improvement Created: 2008-11-18T19:29:03.000+0000 Last Updated: 2008-12-21T05:43:06.000+0000 Status: Resolved Fix version(s): - 1.7.1 (01/Dec/08)

Reporter: l c (cromulent) Assignee: Thomas Weidner (thomas) Tags: - Zend_File_Transfer

  • Zend_Form

Related issues: Attachments:


There was a similar ticket opened which was marked as resolved (ZF-4150), but I am still having the error in ZF 1.7

When setting a translator at the form level, the error messages are all translated for all elements except for the File element

Code to reproduce error, submit the form without selecting a file and you will see the error message remains un-translated:

<pre class="highlight">
$form = new Zend_Form();

$translate = new Zend_Translate('array', array(
    Zend_Validate_File_Upload::NO_FILE => 'Test translation',
), 'en');

$form->setAttrib('enctype', 'multipart/form-data');

$form->addElement('file', 'upload', array(
    'label' => 'Upload',
    'required' => true

$form->addElement('submit', 'save', array(
    'label' => 'Upload'

if ($this->getRequest()->isPost() && $form->isValid($_POST)) {
    // process form

$this->view->form = $form;


Posted by Thomas Weidner (thomas) on 2008-11-19T00:00:44.000+0000

Feature only integrated at adapter and validator level for now.

Posted by Thomas Weidner (thomas) on 2008-11-20T14:30:33.000+0000

Feature added with r12728

Have you found an issue?

See the Overview section for more details.


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

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