ZF-9962: Improve the way forms are translated

Description

Currently, you command the translator in form elements using setDisableTranslator() method. If you set it to true, everything is translated, if you set it to false, nothing is translated.

That's fine but have some limits.

For example, in some cases, you might need that the values are not translated, imagine a select box with people names or hours. You don't want '12:00 AM' or 'John Smith' to be translated nor you want it to figure in the not translated messages log.

So you might think that you have to disable the translator. But at that moment, you will disable the translation for the error messages, the label and everything else.

So, to hack the system, you could disable the translator only before you add the values and activate it right after that. But it seems that the values are translated at different places. For examples, Labels are translated in the decorator. In Zend_Form_Element_Multi, values are translated when you set them AND when you get them.

Anyways, it's currently impossible (as far as I know) to tell an element not to translate the values but to translate everything else and this feature could save hours to everyone and to the servers.

Comments

No comments to display