diff --git a/includes/UniversalLanguageSelectorHooks.php b/includes/UniversalLanguageSelectorHooks.php index 298c9d1b..01530889 100644 --- a/includes/UniversalLanguageSelectorHooks.php +++ b/includes/UniversalLanguageSelectorHooks.php @@ -112,6 +112,7 @@ class UniversalLanguageSelectorHooks { $override = is_array( $excludedLinks ) && in_array( '*', $excludedLinks ); $config = [ 'wgULSPosition' => $wgULSPosition, + 'wgULSisCompactLinksEnabled' => self::isCompactLinksEnabled( $out->getUser() ), ]; // Load compact links if no mw-interlanguage-selector element is present in the page HTML. diff --git a/resources/js/ext.uls.interface.js b/resources/js/ext.uls.interface.js index 21388217..75f68583 100644 --- a/resources/js/ext.uls.interface.js +++ b/resources/js/ext.uls.interface.js @@ -245,6 +245,15 @@ !mw.config.get( 'wgULSAnonCanChangeLanguage' ) ), configPosition = mw.config.get( 'wgULSPosition' ); + if ( !mw.config.get( 'wgULSisCompactLinksEnabled' ) ) { + // The wgULSisCompactLinksEnabled flag when disabled will not render a language button to the page + // Skins can control where the button is placed, by adding an element with mw-interlanguage-selector to the page, + // the display of which is not impacted by this flag. To signal to these skins that the language button should be + // disabled, the class is removed. + $( '.mw-interlanguage-selector' ).removeClass( 'mw-interlanguage-selector' ); + return; + } + if ( configPosition === 'interlanguage' ) { // TODO: Refactor this block // The interlanguage links section.