Call static Language::fetchLanguageName() statically
Change-Id: I3203ec8c601bc869b5c1b153fb745620ff9c03f6
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user