Combine return paths in getLanguagesCached

Also use single quotes instead of double quotes and fix typos.

Change-Id: Ibfd855f55f38ea824d38ad858b654d8229838cd1
This commit is contained in:
Fomafix 2021-10-23 12:32:13 +00:00
parent 4768a3695d
commit 574bbfd549
2 changed files with 10 additions and 11 deletions

View File

@ -128,10 +128,9 @@ class SkinVector extends SkinMustache {
* @return array
*/
private function getLanguagesCached(): array {
if ( $this->languages !== null ) {
return $this->languages;
if ( $this->languages === null ) {
$this->languages = $this->getLanguages();
}
$this->languages = $this->getLanguages();
return $this->languages;
}
@ -168,7 +167,7 @@ class SkinVector extends SkinMustache {
/**
* If in modern Vector and no languages possible, OR the languages in header button
* is enabled but language array is empty, then we shouldn't show the langauge list.
* is enabled but language array is empty, then we shouldn't show the language list.
* @return bool
*/
private function shouldHideLanguages() {
@ -295,12 +294,12 @@ class SkinVector extends SkinMustache {
'data-user-page' => $menuData[ 'data-user-page' ],
] );
$userMoreData = [
"id" => 'p-personal-more',
"class" => 'mw-portlet mw-portlet-personal-more vector-menu vector-user-menu-more',
"html-items" => $userMoreHtmlItems,
"label" => $this->msg( 'vector-personal-more-label' ),
"heading-class" => 'vector-menu-heading',
"is-dropdown" => false,
'id' => 'p-personal-more',
'class' => 'mw-portlet mw-portlet-personal-more vector-menu vector-user-menu-more',
'html-items' => $userMoreHtmlItems,
'label' => $this->msg( 'vector-personal-more-label' ),
'heading-class' => 'vector-menu-heading',
'is-dropdown' => false,
];
$userMenuData = $menuData[ 'data-user-menu' ];

View File

@ -114,7 +114,7 @@ body {
.mixin-clearfix();
}
// TODO: Can be changed to `.mw-body .mw-portlet-lang` when langauge-in-header feature is default.
// TODO: Can be changed to `.mw-body .mw-portlet-lang` when language-in-header feature is default.
.mw-body #p-lang-btn {
float: right;
}