diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationTest.php index a4bcb7a..9574a14 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleTranslationTest.php @@ -98,7 +98,7 @@ function testStringTranslation() { ); // No t() here, it's surely not translated yet. $this->assertText($name, t('name found on edit screen.')); - $this->assertNoText('English', t('No way to translate the string to English.')); + $this->assertNoRaw('>English<', t('No way to translate the string to English.')); $this->drupalLogout(); $this->drupalLogin($admin_user); $this->drupalPost('admin/config/regional/language/edit/en', array('locale_translate_english' => TRUE), t('Save language')); diff --git a/core/modules/locale/locale.pages.inc b/core/modules/locale/locale.pages.inc index 47ad131..87333d9 100644 --- a/core/modules/locale/locale.pages.inc +++ b/core/modules/locale/locale.pages.inc @@ -296,9 +296,9 @@ function locale_translate_edit_form($form, &$form_state) { ); $form['strings'][$string->lid]['original'] = array( '#type' => 'item', - '#title' => t('Source string'), + '#title' => t('Source string (@language)', array('@language' => t('Built-in English'))), '#title_display' => 'invisible', - '#markup' => check_plain($source_array[0]), + '#markup' => '' . check_plain($source_array[0]) . '', ); } else { @@ -310,18 +310,19 @@ function locale_translate_edit_form($form, &$form_state) { $form['strings'][$string->lid]['original_singular'] = array( '#type' => 'item', '#title' => t('Singular form'), - '#markup' => check_plain($source_array[0]), + '#markup' => '' . check_plain($source_array[0]) . '', + '#prefix' => '' . t('Source string (@language)', array('@language' => t('Built-in English'))) . '', ); $form['strings'][$string->lid]['original_plural'] = array( '#type' => 'item', '#title' => t('Plural form'), - '#markup' => check_plain($source_array[1]), + '#markup' => '' . check_plain($source_array[1]) . '', ); } if (!empty($string->context)) { $form['strings'][$string->lid]['context'] = array( '#type' => 'value', - '#value' => check_plain($string->context), + '#value' => '' . check_plain($string->context) . '', ); } // Approximate the number of rows to use in the default textarea. @@ -329,10 +330,11 @@ function locale_translate_edit_form($form, &$form_state) { if (empty($form['strings'][$string->lid]['plural']['#value'])) { $form['strings'][$string->lid]['translations'][0] = array( '#type' => 'textarea', - '#title' => t('Translated string'), + '#title' => t('Translated string (@language)', array('@language' => $langname)), '#title_display' => 'invisible', '#rows' => $rows, '#default_value' => $translation_array[0], + '#attributes' => array('lang' => $langcode), ); } else { @@ -345,6 +347,8 @@ function locale_translate_edit_form($form, &$form_state) { '#title' => ($i == 0 ? t('Singular form') : format_plural($i, 'First plural form', '@count. plural form')), '#rows' => $rows, '#default_value' => isset($translation_array[$i]) ? $translation_array[$i] : '', + '#attributes' => array('lang' => $langcode), + '#prefix' => $i == 0 ? ('' . t('Translated string (@language)', array('@language' => $langname)) . '') : '', ); } } @@ -355,12 +359,15 @@ function locale_translate_edit_form($form, &$form_state) { '#title' => t('Singular form'), '#rows' => $rows, '#default_value' => $translation_array[0], + '#attributes' => array('lang' => $langcode), + '#prefix' => '' . t('Translated string (@language)', array('@language' => $langname)) . '', ); $form['strings'][$string->lid]['translations'][1] = array( '#type' => 'textarea', '#title' => t('Plural form'), '#rows' => $rows, '#default_value' => isset($translation_array[1]) ? $translation_array[1] : '', + '#attributes' => array('lang' => $langcode), ); } }