by Anonymous (nicht überprüft) - 07/20/2010 - 09:45
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.
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