diff --git a/i18n/en.json b/i18n/en.json index fe6ca215..cde8587c 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -16,7 +16,7 @@ "vector-languages": "Languages", "vector-language-button-aria-label": "Go to an article in another language. Available in {{PLURAL:$1|$1 language|$1 languages}}", "vector-language-button-label": "{{PLURAL:$1|$1 language|$1 languages}}", - "vector-language-redirect-to-top": "On this Wikipedia the language links are at the top of the page across from the article title. [[#p-lang-btn|Go to top]].", + "vector-language-redirect-to-top": "On this {{SITENAME}} the language links are at the top of the page across from the article title. [[#p-lang-btn|Go to top]].", "vector-language-variant-switcher-label": "Change language variant", "vector-action-addsection": "Add topic", "vector-action-delete": "Delete", diff --git a/includes/SkinVector.php b/includes/SkinVector.php index df6928f5..2ac378d0 100644 --- a/includes/SkinVector.php +++ b/includes/SkinVector.php @@ -557,7 +557,12 @@ class SkinVector extends SkinMustache { */ private function shouldLanguageAlertBeInSidebar(): bool { $featureManager = VectorServices::getFeatureManager(); - return $featureManager->isFeatureEnabled( Constants::FEATURE_LANGUAGE_ALERT_IN_SIDEBAR ); + $isMainPage = $this->getTitle() ? $this->getTitle()->isMainPage() : false; + $shouldShowOnMainPage = $isMainPage && + $featureManager->isFeatureEnabled( Constants::FEATURE_LANGUAGE_IN_MAIN_PAGE_HEADER ); + return ( $this->isLanguagesInContentAt( 'top' ) && !$isMainPage && + $featureManager->isFeatureEnabled( Constants::FEATURE_LANGUAGE_ALERT_IN_SIDEBAR ) ) || + $shouldShowOnMainPage; } /** @@ -671,7 +676,7 @@ class SkinVector extends SkinMustache { ); // T295555 Add language switch alert message temporarily (to be removed). - if ( $this->shouldLanguageAlertBeInSidebar() && !$parentData['is-mainpage'] ) { + if ( $this->shouldLanguageAlertBeInSidebar() ) { $languageSwitchAlert = [ 'html-content' => Html::rawElement( 'div', [ 'class' => 'messagebox' ],