Hello, assume this situation
$form->addElement('select', 'companies', array(
'disableTranslator' => true,
'label' => Zend_Registry::get('Zend_Translate')->_('companies'),
'filters' => array('Int'),
'required' => true,
'multiOptions' => array(1 => 'Company 1', 2 => 'Company 2')
));
if($_POST && $form->isValid($_POST)) {
$form->save();
}
$form->render();
This select serves to select companies from a given list of options.
The form has a default translator set with 1 translated phrase "my_translated_text" => "here comes the translation"
.
The options in select box are populated based on data entered by users which means users may add a company with name my_translated_text
which in turn should appear as new option in the select box saying "my_translated_text".
If there was no disableTranslator => true
option, the my_translated_text
company would be translated to here comes the translation
and thus appear as translated text -> we need to disable translations.
But if there's disableTranslator => true
the error messages (such as "The value is required") are not translated.
Ideally I don't want to translate the values, but want to translate everything else regarding the select box.
How do you deal with such situation? Have you ever had similar problem?
Thank you