I have got my own module providing a form and there is one element called "Estimated time" defined like this:

$form['informacie_o_incidente']['field_incident_doba'] = array(
  '#title' => t('Estimated time'),
  '#markup' => '<div class="control-group form-item"><label class="control-label">Estimated time:</label><div id="field_incident_doba_wrapper" class="controls">'.$doba.'</div></div>',

I have translated the text "Estimated field" via translation interface, cleared cache several times (both GUI and with drush cc all command). However, when I run this drush command:

drush ev "print t('Estimated time');"

I am getting correctly translated string. So why not on the form?


I think you need add t() in #markup and translate the string 'Estimated time:'

$form['informacie_o_incidente']['field_incident_doba'] = array(
  '#title' => t('Estimated time'),
  '#markup' => '<div class="control-group form-item"><label class="control-label">'.t('Estimated time:').'</label><div id="field_incident_doba_wrapper" class="controls">'.$doba.'</div></div>',
|improve this answer|||||
  • How could I be so blind??? Thanks, mate. – petiar Apr 29 '13 at 2:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.