summaryrefslogtreecommitdiff
path: root/includes/form.inc
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2006-08-18 12:17:00 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2006-08-18 12:17:00 +0000
commit81938a3cdc7b9bd13d58e355c59d9835e830fea4 (patch)
tree4d6156a6edb7898d74d5b1836b80d08750aa39c2 /includes/form.inc
parent885a29c4cd13776165c40080a00180cddd420a46 (diff)
downloadbrdo-81938a3cdc7b9bd13d58e355c59d9835e830fea4.tar.gz
brdo-81938a3cdc7b9bd13d58e355c59d9835e830fea4.tar.bz2
#76802: Introduce placeholder magic into t()
See: http://drupal.org/node/64279#t-placeholders
Diffstat (limited to 'includes/form.inc')
-rw-r--r--includes/form.inc8
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 3fe498406..291933d1f 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -283,7 +283,7 @@ function _form_validate($elements, $form_id = NULL) {
// and a textfield could return '0' and empty('0') returns TRUE so we
// need a special check for the '0' string.
if ($elements['#required'] && empty($elements['#value']) && $elements['#value'] !== '0') {
- form_error($elements, t('%name field is required.', array('%name' => $elements['#title'])));
+ form_error($elements, t('!name field is required.', array('!name' => $elements['#title'])));
}
// Add legal choice check if element has #options. Can be skipped, but then you must validate your own element.
@@ -299,7 +299,7 @@ function _form_validate($elements, $form_id = NULL) {
foreach ($value as $v) {
if (!isset($options[$v])) {
form_error($elements, t('An illegal choice has been detected. Please contact the site administrator.'));
- watchdog('form', t('Illegal choice %choice in %name element.', array('%choice' => theme('placeholder', check_plain($v)), '%name' => theme_placeholder(empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title']))), WATCHDOG_ERROR);
+ watchdog('form', t('Illegal choice %choice in !name element.', array('%choice' => $v, '!name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title'])), WATCHDOG_ERROR);
}
}
}
@@ -1147,10 +1147,10 @@ function theme_form_element($element, $value) {
if (!empty($element['#title'])) {
$title = $element['#title'];
if (!empty($element['#id'])) {
- $output .= ' <label for="'. form_clean_id($element['#id']) .'">'. t('%title: %required', array('%title' => $title, '%required' => $required)) ."</label>\n";
+ $output .= ' <label for="'. form_clean_id($element['#id']) .'">'. t('!title: !required', array('!title' => $title, '!required' => $required)) ."</label>\n";
}
else {
- $output .= ' <label>'. t('%title: %required', array('%title' => $title, '%required' => $required)) ."</label>\n";
+ $output .= ' <label>'. t('!title: !required', array('!title' => $title, '!required' => $required)) ."</label>\n";
}
}