diff --git a/core/modules/language/lib/Drupal/language/Plugin/LanguageNegotiation/LanguageNegotiationSession.php b/core/modules/language/lib/Drupal/language/Plugin/LanguageNegotiation/LanguageNegotiationSession.php index e56278d..287ba62 100644 --- a/core/modules/language/lib/Drupal/language/Plugin/LanguageNegotiation/LanguageNegotiationSession.php +++ b/core/modules/language/lib/Drupal/language/Plugin/LanguageNegotiation/LanguageNegotiationSession.php @@ -135,7 +135,7 @@ function getLanguageSwitchLinks(Request $request, $type, $path) { $langcode = $language->id; $links[$langcode] = array( 'href' => $path, - 'title' => $language->name, + 'title' => t($language->name, array(), array('langcode' => $language->id)), 'attributes' => array('class' => array('language-link')), 'query' => $query, ); diff --git a/core/modules/language/lib/Drupal/language/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php b/core/modules/language/lib/Drupal/language/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php index 71a93ca..54ca73c 100644 --- a/core/modules/language/lib/Drupal/language/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php +++ b/core/modules/language/lib/Drupal/language/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php @@ -191,7 +191,7 @@ function getLanguageSwitchLinks(Request $request, $type, $path) { foreach ($this->languageManager->getNativeLanguages() as $language) { $links[$language->id] = array( 'href' => $path, - 'title' => $language->name, + 'title' => t($language->name, array(), array('langcode' => $language->id)), 'language' => $language, 'attributes' => array('class' => array('language-link')), ); diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageSwitchingTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageSwitchingTest.php index 3a01c75..6903c37 100644 --- a/core/modules/language/lib/Drupal/language/Tests/LanguageSwitchingTest.php +++ b/core/modules/language/lib/Drupal/language/Tests/LanguageSwitchingTest.php @@ -43,13 +43,6 @@ function setUp() { * Functional tests for the language switcher block. */ function testLanguageBlock() { - // Enable the language switching block.. - $block = $this->drupalPlaceBlock('language_block:' . Language::TYPE_INTERFACE, array( - 'id' => 'test_language_block', - // Ensure a 2-byte UTF-8 sequence is in the tested output. - 'label' => $this->randomName(8) . '×', - )); - // Add language. $edit = array( 'predefined_langcode' => 'fr', @@ -63,6 +56,13 @@ function testLanguageBlock() { $edit = array('language_interface[enabled][language-url]' => '1'); $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings')); + // Enable the language switching block.. + $block = $this->drupalPlaceBlock('language_block:' . Language::TYPE_INTERFACE, array( + 'id' => 'test_language_block', + // Ensure a 2-byte UTF-8 sequence is in the tested output. + 'label' => $this->randomName(8) . '×', + )); + $this->doTestLanguageBlockAuthenticated($block->label()); $this->doTestLanguageBlockAnonymous($block->label()); }