diff --git a/core/modules/language/src/Plugin/Block/LanguageBlock.php b/core/modules/language/src/Plugin/Block/LanguageBlock.php index 9dcf697..bbaa68e 100644 --- a/core/modules/language/src/Plugin/Block/LanguageBlock.php +++ b/core/modules/language/src/Plugin/Block/LanguageBlock.php @@ -109,8 +109,16 @@ public function build() { $path = drupal_is_front_page() ? '' : current_path(); $type = $this->getDerivativeId(); $links = $this->languageManager->getLanguageSwitchLinks($type, $path); + $current_language = $this->languageManager->getCurrentLanguage()->getId(); if (isset($links->links)) { + if ($this->configuration['block_type'] == 'type') { + // This sets current language to first place. + $default_link = $links->links[$current_language]; + unset($links->links[$current_language]); + array_unshift($links->links, $default_link); + } + $build = array( '#links' => $links->links, '#attributes' => array(