By keuvain33 on
Hello everyone,
Can anybody help me in this issue :
I use l10n and I translate every field except #default_value.
For exemple, with simplenews module I can't translate "Stay informed on our latest news!"
Or in search module, I can't translate "Search"
It's just my hook_form_alter to use js.
function search_box_modification_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'search_theme_form') {
$form[$form_id] = array(
'#title' => t(''),
'#type' => 'textfield',
'#size' => 15,
'#default_value' => 'Search',
'#attributes' => array('onblur' => "if(this.value=='')this.value='Search';", 'onfocus' => "if(this.value=='Search')this.value='';"),
);
$form['submit'] = array('#type' => 'submit', '#value' => t('OK'));
$form['#submit'][] = 'search_box_form_submit';
$form['#validate'][] = 'search_box_form_validate';
}
}
Thanking you in advance !
Comments
I have a really problem and
I have a really problem and nobody talk about a solution.
Anyone could help me???
Thank you in advance !
Nobody have a solution?
Nobody have a solution?
Up please
Up please
Use the t() function
You need to pass the text through the
t()function in order for it to be translatable.E.g.,
Thank you for my "newbisme".
Thank you for my "newbisme". Now it's working perfectly