From 6e93ccfb2e444ad40e951b0372097bb448152741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Laxstr=C3=B6m?= Date: Tue, 16 Jun 2020 09:39:02 +0200 Subject: [PATCH] Minimal fix for broken language trigger in ContentTranslation Bug: T255331 Change-Id: If81613f6a9784535e25feef56335afb290023749 --- includes/UniversalLanguageSelectorHooks.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/UniversalLanguageSelectorHooks.php b/includes/UniversalLanguageSelectorHooks.php index e7b2c4ad..77396314 100644 --- a/includes/UniversalLanguageSelectorHooks.php +++ b/includes/UniversalLanguageSelectorHooks.php @@ -135,6 +135,9 @@ class UniversalLanguageSelectorHooks { $out->addModules( 'ext.uls.interface' ); } + // This is added here, and not in addConfig to allow skins and extensions to vary it + // For example, ContentTranslation special pages depend on being able to change it. + $out->addJsConfigVars( 'wgULSPosition', $wgULSPosition ); if ( $wgULSPosition === 'personal' ) { $out->addModuleStyles( 'ext.uls.pt' ); } else { @@ -354,7 +357,7 @@ class UniversalLanguageSelectorHooks { public static function addConfig( array &$vars ) { global $wgULSGeoService, $wgULSIMEEnabled, $wgULSWebfontsEnabled, - $wgULSPosition, $wgULSNoWebfontsSelectors, + $wgULSNoWebfontsSelectors, $wgULSAnonCanChangeLanguage, $wgULSEventLogging, $wgULSImeSelectors, $wgULSNoImeSelectors, @@ -370,7 +373,6 @@ class UniversalLanguageSelectorHooks { $vars['wgULSIMEEnabled'] = $wgULSIMEEnabled; $vars['wgULSWebfontsEnabled'] = $wgULSWebfontsEnabled; - $vars['wgULSPosition'] = $wgULSPosition; $vars['wgULSAnonCanChangeLanguage'] = $wgULSAnonCanChangeLanguage; $vars['wgULSEventLogging'] = $wgULSEventLogging && ExtensionRegistry::getInstance()->isLoaded( 'EventLogging' );