Load wgULSCurrentAutonym variable in MakeGlobalVariablesScript hook
The ResourceLoaderGetConfigVars hook is intended for static variables, not ones that depend on the current request. Change-Id: I596495bd103e5b7735fb454e3b5f12cd4257ee99
This commit is contained in:
@@ -271,10 +271,6 @@ class UniversalLanguageSelectorHooks {
|
||||
$vars['wgULSNoImeSelectors'] = $wgULSNoImeSelectors;
|
||||
$vars['wgULSNoWebfontsSelectors'] = $wgULSNoWebfontsSelectors;
|
||||
|
||||
// An optimization to avoid loading all of uls.data just to get the autonym
|
||||
$lang = RequestContext::getMain()->getLanguage();
|
||||
$vars['wgULSCurrentAutonym'] = $lang->fetchLanguageName( $lang->getCode() );
|
||||
|
||||
if ( is_string( $wgULSFontRepositoryBasePath ) ) {
|
||||
$vars['wgULSFontRepositoryBasePath'] = $wgULSFontRepositoryBasePath;
|
||||
} else {
|
||||
@@ -295,6 +291,10 @@ class UniversalLanguageSelectorHooks {
|
||||
// Place request context dependent stuff here
|
||||
$vars['wgULSAcceptLanguageList'] = array_keys( $out->getRequest()->getAcceptLang() );
|
||||
|
||||
// An optimization to avoid loading all of uls.data just to get the autonym
|
||||
$lang = $out->getLanguage();
|
||||
$vars['wgULSCurrentAutonym'] = $lang->fetchLanguageName( $lang->getCode() );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user