Wikimedia\Services. The old name is still supported, but deprecated.
* (T155582) Content::getNativeData has been deprecated. Please use model-
specific getters, such as TextContent::getText().
+* The class WebInstallerOutput is now marked as @private.
* …
=== Other changes in 1.33 ===
*
* @ingroup Deployment
* @since 1.17
+ * @private
*/
class WebInstallerOutput {
$rlContext = new ResourceLoaderContext( $resourceLoader, new FauxRequest( [
'debug' => 'true',
- 'lang' => $this->getLanguageCode(),
+ 'lang' => $this->getLanguage()->getCode(),
'only' => 'styles',
] ) );
}
/**
- * @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' );
}
/**
*/
public function getHeadAttribs() {
return [
- 'dir' => $this->getDir(),
- 'lang' => LanguageCode::bcp47( $this->getLanguageCode() ),
+ 'dir' => $this->getLanguage()->getDir(),
+ 'lang' => $this->getLanguage()->getHtmlCode(),
];
}
<?php echo Html::linkedScript( 'config.js' ) . "\n"; ?>
</head>
-<?php echo Html::openElement( 'body', [ 'class' => $this->getDir() ] ) . "\n"; ?>
+<?php echo Html::openElement( 'body', [ 'class' => $this->getLanguage()->getDir() ] ) . "\n"; ?>
<div id="mw-page-base"></div>
<div id="mw-head-base"></div>
<div id="content" class="mw-body">