summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2011-05-15 17:38:57 -0700
committerDries Buytaert <dries@buytaert.net>2011-05-15 17:38:57 -0700
commit78f4cc01c110731cf657deec257bf9cbb0f2d426 (patch)
treef89a163907a003d737c890d14b81178dea97c72c
parent2c7a84fd32eebf124135c580dfafe84816b3859e (diff)
downloadbrdo-78f4cc01c110731cf657deec257bf9cbb0f2d426.tar.gz
brdo-78f4cc01c110731cf657deec257bf9cbb0f2d426.tar.bz2
- Patch #1157426 by Gábor Hojtsy: field system uses t() incorrectly and inconsistently.
-rw-r--r--modules/field/field.default.inc4
-rw-r--r--modules/field/field.form.inc6
-rw-r--r--modules/field/modules/list/list.module2
-rw-r--r--modules/field/modules/number/number.module8
-rw-r--r--modules/field_ui/field_ui.module3
-rw-r--r--modules/taxonomy/taxonomy.module2
6 files changed, 12 insertions, 13 deletions
diff --git a/modules/field/field.default.inc b/modules/field/field.default.inc
index 93b5bea95..a10d1387f 100644
--- a/modules/field/field.default.inc
+++ b/modules/field/field.default.inc
@@ -81,7 +81,7 @@ function field_default_validate($entity_type, $entity, $field, $instance, $langc
if ($field['cardinality'] != FIELD_CARDINALITY_UNLIMITED && count($items) > $field['cardinality']) {
$errors[$field['field_name']][$langcode][0][] = array(
'error' => 'field_cardinality',
- 'message' => t('%name: this field cannot hold more than @count values.', array('%name' => t($instance['label']), '@count' => $field['cardinality'])),
+ 'message' => t('%name: this field cannot hold more than @count values.', array('%name' => $instance['label'], '@count' => $field['cardinality'])),
);
}
}
@@ -214,7 +214,7 @@ function field_default_view($entity_type, $entity, $field, $instance, $langcode,
$info = array(
'#theme' => 'field',
'#weight' => $display['weight'],
- '#title' => t($instance['label']),
+ '#title' => $instance['label'],
'#access' => field_access('view', $field, $entity_type, $entity),
'#label_display' => $display['label'],
'#view_mode' => $view_mode,
diff --git a/modules/field/field.form.inc b/modules/field/field.form.inc
index f5782818d..845f04109 100644
--- a/modules/field/field.form.inc
+++ b/modules/field/field.form.inc
@@ -69,7 +69,7 @@ function field_default_form($entity_type, $entity, $field, $instance, $langcode,
'#language' => $langcode,
'#field_parents' => $parents,
'#columns' => array_keys($field['columns']),
- '#title' => check_plain(t($instance['label'])),
+ '#title' => check_plain($instance['label']),
'#description' => field_filter_xss($instance['description']),
// Only the first widget should be required.
'#required' => $delta == 0 && $instance['required'],
@@ -151,8 +151,8 @@ function field_multiple_value_form($field, $instance, $langcode, $items, &$form,
break;
}
- $title = check_plain(t($instance['label']));
- $description = field_filter_xss(t($instance['description']));
+ $title = check_plain($instance['label']);
+ $description = field_filter_xss($instance['description']);
$id_prefix = implode('-', array_merge($parents, array($field_name)));
$wrapper_id = drupal_html_id($id_prefix . '-add-more-wrapper');
diff --git a/modules/field/modules/list/list.module b/modules/field/modules/list/list.module
index f7ac95172..608679bbb 100644
--- a/modules/field/modules/list/list.module
+++ b/modules/field/modules/list/list.module
@@ -379,7 +379,7 @@ function list_field_validate($entity_type, $entity, $field, $instance, $langcode
if (!empty($allowed_values) && !isset($allowed_values[$item['value']])) {
$errors[$field['field_name']][$langcode][$delta][] = array(
'error' => 'list_illegal_value',
- 'message' => t('%name: illegal value.', array('%name' => t($instance['label']))),
+ 'message' => t('%name: illegal value.', array('%name' => $instance['label'])),
);
}
}
diff --git a/modules/field/modules/number/number.module b/modules/field/modules/number/number.module
index fe1221cf0..20e380777 100644
--- a/modules/field/modules/number/number.module
+++ b/modules/field/modules/number/number.module
@@ -138,13 +138,13 @@ function number_field_validate($entity_type, $entity, $field, $instance, $langco
if (is_numeric($instance['settings']['min']) && $item['value'] < $instance['settings']['min']) {
$errors[$field['field_name']][$langcode][$delta][] = array(
'error' => 'number_min',
- 'message' => t('%name: the value may be no less than %min.', array('%name' => t($instance['label']), '%min' => $instance['settings']['min'])),
+ 'message' => t('%name: the value may be no less than %min.', array('%name' => $instance['label'], '%min' => $instance['settings']['min'])),
);
}
if (is_numeric($instance['settings']['max']) && $item['value'] > $instance['settings']['max']) {
$errors[$field['field_name']][$langcode][$delta][] = array(
'error' => 'number_max',
- 'message' => t('%name: the value may be no greater than %max.', array('%name' => t($instance['label']), '%max' => $instance['settings']['max'])),
+ 'message' => t('%name: the value may be no greater than %max.', array('%name' => $instance['label'], '%max' => $instance['settings']['max'])),
);
}
}
@@ -367,12 +367,12 @@ function number_field_widget_validate($element, &$form_state) {
case 'float':
case 'decimal':
$regexp = '@[^-0-9\\' . $field['settings']['decimal_separator'] . ']@';
- $message = t('Only numbers and the decimal separator (@separator) allowed in %field.', array('%field' => t($instance['label']), '@separator' => $field['settings']['decimal_separator']));
+ $message = t('Only numbers and the decimal separator (@separator) allowed in %field.', array('%field' => $instance['label'], '@separator' => $field['settings']['decimal_separator']));
break;
case 'integer':
$regexp = '@[^-0-9]@';
- $message = t('Only numbers are allowed in %field.', array('%field' => t($instance['label'])));
+ $message = t('Only numbers are allowed in %field.', array('%field' => $instance['label']));
break;
}
if ($value != preg_replace($regexp, '', $value)) {
diff --git a/modules/field_ui/field_ui.module b/modules/field_ui/field_ui.module
index 59b2beb66..7355e879b 100644
--- a/modules/field_ui/field_ui.module
+++ b/modules/field_ui/field_ui.module
@@ -233,7 +233,7 @@ function field_ui_menu_load($field_name, $entity_type, $bundle_name, $bundle_pos
* Menu title callback.
*/
function field_ui_menu_title($instance) {
- return t($instance['label']);
+ return $instance['label'];
}
/**
@@ -362,4 +362,3 @@ function field_ui_form_node_type_form_submit($form, &$form_state) {
$form_state['redirect'] = _field_ui_bundle_admin_path('node', $form_state['values']['type']) .'/fields';
}
}
-
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index f08df601e..5fb41e61f 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -1316,7 +1316,7 @@ function taxonomy_field_validate($entity_type, $entity, $field, $instance, $lang
if (!$validate) {
$errors[$field['field_name']][$langcode][$delta][] = array(
'error' => 'taxonomy_term_reference_illegal_value',
- 'message' => t('%name: illegal value.', array('%name' => t($instance['label']))),
+ 'message' => t('%name: illegal value.', array('%name' => $instance['label'])),
);
}
}