Get a list of the current user's Accept-Language codes
Change-Id: I2c8742f56e34aed8a368bb5add2cff30fa89ad33
This commit is contained in:
committed by
Niklas Laxström
parent
7cbaf20937
commit
610cc362ac
@@ -104,10 +104,20 @@ class UniversalLanguageSelectorHooks {
|
||||
* Hook: ResourceLoaderGetConfigVars
|
||||
* @param $vars Array
|
||||
* @return bool
|
||||
*/
|
||||
*/
|
||||
public static function addConfig( &$vars ) {
|
||||
global $wgContLang;
|
||||
$vars['wgULSLanguages'] = Language::fetchLanguageNames( $wgContLang->getCode(), 'mwfile' );
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook: MakeGlobalVariablesScript
|
||||
* @param $vars Array
|
||||
* @return bool
|
||||
*/
|
||||
public static function addVariables( &$vars, OutputPage $out ) {
|
||||
$vars['wgULSAcceptLanguageList'] = array_keys( $out->getRequest()->getAcceptLang() );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user