Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.7.0
-
Fix Version/s: 1.7.1
-
Component/s: Zend_File_Transfer, Zend_Form
-
Labels:None
Description
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:
$form = new Zend_Form(); $translate = new Zend_Translate('array', array( Zend_Validate_File_Upload::NO_FILE => 'Test translation', ), 'en'); Zend_Form::setDefaultTranslator($translate); $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;
Feature only integrated at adapter and validator level for now.