ZF-2662: disableTranslator flag in Zend_Form_Element


Currently there is no way to specify that a particular element in a given form should NOT be translated even if a default translator instance is available in Zend_Form. As per the discussion referenced below, I am suggesting the addition of a disableTranslator flag in Zend_Form_Element which would allow automatic translation to be turned off on an element-by-element basis.

For original discussion, seeā€¦

The original discussion primarily references the option labels in select menu form fields; however, this flag should apply to other kinds of properties in other elements as well (for instance, the "description" and "label" properties).


Added a minor clarification to the issue description.

Will need to add: * accessor, disableTranslator(), to Zend_Form_Element * logic to Zend_Form_Element::getDefaultTranslator() to not pull from Zend_Form or the current element when disableTranslator is true

Zend_Form, Element, and DisplayGroup all now have a 'setDisableTranslator()' method (and corresponding config key 'disableTranslator') that allows you to disable translations for that item (setting it on the form will disable for the entire form).



// Check the flag status:
if ($form->translatorIsDisabled()) {
    // disabled!

Committed to trunk and release branch.