Reply to comment

Because t() is designed for

Because t() is designed for handling code-based strings, in almost all cases, the actual string and not a variable must be passed through t().

Extraction of translations is done based on the strings contained in t() calls. If a variable is passed through t(), the content of the variable cannot be extracted from the file for translation.

Incorrect:

<?php

$message = 'An error occurred.';
drupal_set_message(t($message), 'error');
$output .= t($message);

?>

Correct:

<?php

$message = t('An error occurred.');
drupal_set_message($message, 'error');
$output .= $message;

?>

see http://api.drupal.org/api/function/t/6

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options