Reply to comment

Block Titles

Block titles should show up in admin/build/translate on their own. There should not be any need to add t() strings to the template.

Be careful with t() and variables, as I am pretty sure what you have suggested is dangerous. Read the Drupal API documentation to learn more.

http://api.drupal.org/api/drupal/includes--common.inc/function/t/6

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;
?>

Reply

  • 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