Merge "SpecialMyLanguage: Get content language from service"
[lhc/web/wiklou.git] / includes / skins / Skin.php
index dde60f5..83d02a0 100644 (file)
@@ -231,6 +231,7 @@ abstract class Skin extends ContextSource {
 
                if ( $out->isTOCEnabled() ) {
                        $modules['content'][] = 'mediawiki.toc';
+                       $modules['styles']['content'][] = 'mediawiki.toc.styles';
                }
 
                // Add various resources if required
@@ -400,15 +401,14 @@ abstract class Skin extends ContextSource {
         * @param string|null $nonce OutputPage::getCSPNonce()
         * @return string|WrappedString HTML
         */
-       static function makeVariablesScript( $data, $nonce = null ) {
+       public static function makeVariablesScript( $data, $nonce = null ) {
                if ( $data ) {
                        return ResourceLoader::makeInlineScript(
                                ResourceLoader::makeConfigSetScript( $data ),
                                $nonce
                        );
-               } else {
-                       return '';
                }
+               return '';
        }
 
        /**
@@ -1306,7 +1306,7 @@ abstract class Skin extends ContextSource {
                                [
                                        'checkKeys' => [
                                                // Unless there is both no exact $code override nor an i18n definition
-                                               // in the the software, the only MediaWiki page to check is for $code.
+                                               // in the software, the only MediaWiki page to check is for $code.
                                                $msgCache->getCheckKey( $this->getLanguage()->getCode() )
                                        ],
                                        'lockTSE' => 30
@@ -1526,7 +1526,7 @@ abstract class Skin extends ContextSource {
         *   should fall back to the next notice in its sequence
         */
        private function getCachedNotice( $name ) {
-               global $wgRenderHashAppend, $wgContLang;
+               global $wgRenderHashAppend;
 
                $needParse = false;
 
@@ -1559,12 +1559,13 @@ abstract class Skin extends ContextSource {
                        }
                );
 
+               $contLang = MediaWikiServices::getInstance()->getContentLanguage();
                return Html::rawElement(
                        'div',
                        [
                                'id' => 'localNotice',
-                               'lang' => $wgContLang->getHtmlCode(),
-                               'dir' => $wgContLang->getDir()
+                               'lang' => $contLang->getHtmlCode(),
+                               'dir' => $contLang->getDir()
                        ],
                        $parsed
                );