X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FWebInstallerOutput.php;h=ae07d0cbda5a276cd4c7ae9c612bba1534f004cd;hb=24b59673133bc6f74c19540fd92fda3a3faffc45;hp=6c1f2ec2b705f45547feb461b1fc4e766bb6e4a5;hpb=fbc9e214e7c6f687e7dc3a3178e60f4164ed9ad6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/WebInstallerOutput.php b/includes/installer/WebInstallerOutput.php index 6c1f2ec2b7..ae07d0cbda 100644 --- a/includes/installer/WebInstallerOutput.php +++ b/includes/installer/WebInstallerOutput.php @@ -31,6 +31,7 @@ * * @ingroup Deployment * @since 1.17 + * @private */ class WebInstallerOutput { @@ -166,7 +167,7 @@ class WebInstallerOutput { $rlContext = new ResourceLoaderContext( $resourceLoader, new FauxRequest( [ 'debug' => 'true', - 'lang' => $this->getLanguageCode(), + 'lang' => $this->getLanguage()->getCode(), 'only' => 'styles', ] ) ); @@ -197,7 +198,7 @@ class WebInstallerOutput { * @return string */ private function getCssUrl() { - return Html::linkedStyle( $_SERVER['PHP_SELF'] . '?css=1' ); + return Html::linkedStyle( $this->parent->getUrl( [ 'css' => 1 ] ) ); } public function useShortHeader( $use = true ) { @@ -220,21 +221,13 @@ class WebInstallerOutput { } /** - * @return string - */ - public function getDir() { - global $wgLang; - - return is_object( $wgLang ) ? $wgLang->getDir() : 'ltr'; - } - - /** - * @return string + * @since 1.33 + * @return Language */ - public function getLanguageCode() { + private function getLanguage() { global $wgLang; - return is_object( $wgLang ) ? $wgLang->getCode() : 'en'; + return is_object( $wgLang ) ? $wgLang : Language::factory( 'en' ); } /** @@ -242,8 +235,8 @@ class WebInstallerOutput { */ public function getHeadAttribs() { return [ - 'dir' => $this->getDir(), - 'lang' => LanguageCode::bcp47( $this->getLanguageCode() ), + 'dir' => $this->getLanguage()->getDir(), + 'lang' => $this->getLanguage()->getHtmlCode(), ]; } @@ -287,7 +280,7 @@ class WebInstallerOutput { - $this->getDir() ] ) . "\n"; ?> + $this->getLanguage()->getDir() ] ) . "\n"; ?>