API page: http://api.drupal.org/api/drupal/core%21includes%21form.inc/function/the...
The function contains the following code.
$element = &$variables['element'];
// This is also used in the installer, pre-database setup.
$t = get_t();
$t is never used from the theme function.
That code is remains of Drupal 6 code, where the variable was used from the following code.
if (!empty($element['#id'])) {
$output .= ' <label for="' . $element['#id'] . '">' . $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) . "</label>\n";
}
else {
$output .= ' <label>' . $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) . "</label>\n";
}
The code has been changed since Drupal 7, but the variable is still initialized.
Comments
Comment #1
avpadernoThe function that handles the form element label is
theme_form_element_label(), which is correctly usingget_t().Comment #2
swentel commentedComment #3
catchThanks! Committed/pushed to 8.x.
Comment #4
avpadernoComment #5
avpadernoI didn't notice the title was changed.
Comment #6
swentel commentedGood to go.
Comment #7
David_Rothstein commentedCommitted to 7.x - thanks! http://drupalcode.org/project/drupal.git/commit/9ae47ea