ZF-4150: Zend_Form_Element_File doesn't translate error messages
I use zend translator with my forms to translate error messages, and it goes well. But this doesn't work with file form element. I found a fix and I place the diff in attachment.
To fix the problem I try to reproduce the behavior of the other form elements. So first, the Zend_Form_Element_File#isValid function had to pass the translator on the transfer adapter by using the Zend_File_Transfer_Adapter_Abstract#setTranslator method. Then, the transfer adapter does the same thing by calling setTranslator on validators that have the method (such as Zend_Validate_Abstract). The last thing that need to be added, is the Zend_File_Transfer_Adapter_Abstract#setTranslator method. Normally, validators have this method, but the transfer adapter inherits from Zend_Validate_Interface and not Zend_Validate_Abstract. In the fix, I suggest to change the inheritance because it doesn't need a lot of changes. But I think that require more cpu and memory usage and perhaps that will cause others problems.
I work on the 11181 Zend Framework revision.
Thanks for reading.