Делаю сайт мультиязычным,есть веб-форма кастомная с текстами в input(типа "Время окончания аренды*","Номер телефона*"), ,как сделать так чтобы они переводились на английский,весь остальной контент переводится хорошо.
помогите,люди добрые!
внизу кусок кода
function theme_custom_form_theme_function($variables){
$form = $variables['form'];
global $language;
$ln = $language->language;
$output = '';
$form['field_date_of_commencement_of_th']['und'][0]['value']['date']['#value'] = "";
$form['field_date_of_commencement_of_th']['und'][0]['value']['date']['#title_display'] = "invisible";
$form['field_date_of_commencement_of_th']['und'][0]['value']['date']['#description'] = "";
$ln = 'en' ? $date = 'Date' : $date = 'Дата начала аренды*';
$form['field_date_of_commencement_of_th']['und'][0]['value']['date']['#attributes']['placeholder'] = $date;
$form['field_date_of_commencement_of_th']['und'][0]['value']['time']['#value'] = "";
$form['field_date_of_commencement_of_th']['und'][0]['value']['time']['#title_display'] = "invisible";
$form['field_date_of_commencement_of_th']['und'][0]['value']['time']['#description'] = "";
$form['field_date_of_commencement_of_th']['und'][0]['value']['time']['#attributes']['placeholder'] = "Время начала аренды*";
$form['field_ending_date_of_the_lease']['und'][0]['value']['date']['#value'] = "";
$form['field_ending_date_of_the_lease']['und'][0]['value']['date']['#title_display'] = "invisible";
$form['field_ending_date_of_the_lease']['und'][0]['value']['date']['#description'] = "";
$form['field_ending_date_of_the_lease']['und'][0]['value']['date']['#attributes']['placeholder'] = "Дата окончания аренды*";
$form['field_ending_date_of_the_lease']['und'][0]['value']['time']['#value'] = "";
$form['field_ending_date_of_the_lease']['und'][0]['value']['time']['#title_display'] = "invisible";
$form['field_ending_date_of_the_lease']['und'][0]['value']['time']['#description'] = "";
$form['field_ending_date_of_the_lease']['und'][0]['value']['time']['#attributes']['placeholder'] = "Время окончания аренды*";
$form['field_your_name']['und'][0]['value']['#value'] = "";
$form['field_your_name']['und'][0]['value']['#title_display'] = "invisible";
$form['field_your_name']['und'][0]['value']['#description'] = "";
$form['field_your_name']['und'][0]['value']['#attributes']['placeholder'] = "Ваше имя*";
$form['field_your_e_mail']['und'][0]['value']['#value'] = "";
$form['field_your_e_mail']['und'][0]['value']['#title_display'] = "invisible";
$form['field_your_e_mail']['und'][0]['value']['#description'] = "";
$form['field_your_e_mail']['und'][0]['value']['#attributes']['placeholder'] = "Ваш e-mail*";
$form['field_telephone_number']['und'][0]['value']['#value'] = "";
$form['field_telephone_number']['und'][0]['value']['#title_display'] = "invisible";
$form['field_telephone_number']['und'][0]['value']['#description'] = "";
$form['field_telephone_number']['und'][0]['value']['#attributes']['placeholder'] = "Номер телефона*";
$form['field_comments']['und'][0]['value']['#value'] = "";
$form['field_comments']['und'][0]['value']['#title_display'] = "invisible";
$form['field_comments']['und'][0]['value']['#description'] = "";
$form['field_comments']['und'][0]['value']['#attributes']['placeholder'] = "Комментарий";
$form['field_date_of_commencement_of_th']['und'][0]['value']['time']['#id'] .= '-custom';
$form['field_date_of_commencement_of_th']['und'][0]['value']['date']['#id'] .= '-custom';
$form['field_ending_date_of_the_lease']['und'][0]['value']['date']['#id'] .= '-custom';
$form['field_ending_date_of_the_lease']['und'][0]['value']['time']['#id'] .= '-custom';
$output .= '
$output .= drupal_render($form['field_tours']['und']['Day Tour']);
$output .= drupal_render($form['field_tours']['und']['Night Tour']);
$output .= drupal_render($form['field_tours']['und']['Custom Tour']);
$output .= '
';
$output .= '
' . drupal_render($form['field_equipment']['und']['Motorcycle Honda GoldWing 1800']);
$output .= '
' .drupal_render($form['field_equipment']['und']['Tricycle Honda GoldWing 1800']);
$output .= drupal_render_children($form);
$output .= drupal_render_children($form);
$output .= '
';
return $output;
}
Комментарии
[ru-api=][/ru-api]
$form['field_ending_date_of_the_lease']['und'][0]['value']['time']['#attributes']['placeholder'] = t("Время окончания аренды*");
Ну переведи на английский изначально, потом перевод интерфейса в админке, ищи эту фразу и добавляй перевод
Поддерживаем. Обязательно необходимо заполнять текст на английском языке, а уж только потом переводить его на другие языки. Перевод таких текстовых строчек можно сделать на странице ДОМЕН_САЙТА/admin/config/regional/translate/translate
$output .= '
$output .= drupal_render($form['field_tours']['und']['Day Tour]);
$output .= drupal_render($form['field_tours']['und']['Night Tour']);
$output .= drupal_render($form['field_tours']['und']['Custom Tour']);
$output .= '
';
А здесь как перевести на русский Day Tour на Дневной Тур?
Как-то вопрос не совсем понятен.
ДОМЕН_САЙТА/admin/config/regional/translate/translate
не работает?