ZF-6150: Zend_Form_Element_FormImage::setDisableTranslator() does not work
Description
This is true for the current version in svn (1.7.7 ?). It may be true for all form elements, but I did not test that yet. If I can find the time I will do more tests.
//in a custom form, descendant of ZendX_JQuery_Form
$new = $this->createElement('image',
'new',
array('value' => 'new',
'class' => 'button_new',
'title' => 'New',
'disableTranslator' => 'true',// does work
));
$new->setDisableTranslator(true);// @todo: does not work, file an issue
$new->setImage(BASEURL . '/images/icons/new.png');
$this->addElement($new);
In the above snippet, setting the option 'disableTranslator' to true will have the desired effect, while using the function setDisableTranslator has no effect.
One might argue that there is nothing about the FormImage element that has to be translated, but as you can see I am adding the 'title' attribute in the options and I want that to be translated. I know, from the documentation and from the code, that the 'title' attribute will not be translated by design. Therefore I will create a parallel issue of type improvement, to have the title attribute translated.
While I am testing and trying to find a solution to get the title attribute translated (to be able to create translatable tooltips on buttons), I find that this issue does not apply to a submit button, with a submit button setDisableTranslator() works.
Comments
Posted by Bart McLeod (mcleod@spaceweb.nl) on 2009-03-28T04:06:22.000+0000
Set to improvement, but it really is bogus. setDisableTranslator does have no effect because it is called after the translation in my experimental implementation has been completed and with this naive implementation, there is no way to return to the original attribute once it has been translated.
That is why the only way to make it work is passing in 'disableTranslator' as an option.
Posted by Bart McLeod (mcleod@spaceweb.nl) on 2009-03-28T04:08:30.000+0000
'Resolved' it by setting it to 'not an issue'