Merge "Call static Language::fetchLanguageName() statically"

This commit is contained in:
jenkins-bot
2016-04-01 12:49:19 +00:00
committed by Gerrit Code Review

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;
} }