Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 2 down vote accepted

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>',
share|improve this answer
How could I be so blind??? Thanks, mate. – petiar Apr 29 '13 at 2:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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