Call static Language::fetchLanguageName() statically

Change-Id: I3203ec8c601bc869b5c1b153fb745620ff9c03f6
This commit is contained in:
Siebrand Mazeland
2016-03-11 00:17:08 +01:00
parent f8487a54eb
commit 7565fdcf43

View File

@@ -138,10 +138,10 @@ class UniversalLanguageSelectorHooks {
} }
// The element id will be 'pt-uls' // The element id will be 'pt-uls'
$lang = $context->getLanguage(); $langCode = $context->getLanguage()->getCode();
$personal_urls = array( $personal_urls = array(
'uls' => array( 'uls' => array(
'text' => $lang->fetchLanguageName( $lang->getCode() ), 'text' => Language::fetchLanguageName( $langCode ),
'href' => '#', 'href' => '#',
'class' => 'uls-trigger autonym', 'class' => 'uls-trigger autonym',
'active' => true 'active' => true
@@ -303,8 +303,8 @@ class UniversalLanguageSelectorHooks {
$vars['wgULSAcceptLanguageList'] = array_keys( $out->getRequest()->getAcceptLang() ); $vars['wgULSAcceptLanguageList'] = array_keys( $out->getRequest()->getAcceptLang() );
// An optimization to avoid loading all of uls.data just to get the autonym // An optimization to avoid loading all of uls.data just to get the autonym
$lang = $out->getLanguage(); $langCode = $out->getLanguage()->getCode();
$vars['wgULSCurrentAutonym'] = $lang->fetchLanguageName( $lang->getCode() ); $vars['wgULSCurrentAutonym'] = Language::fetchLanguageName( $langCode );
return true; return true;
} }