* Added UserGetLanguageObject hook to change the language used in $wgLang

This commit is contained in:
Alexandre Emsenhuber 2011-03-06 21:05:18 +00:00
parent bb651b0063
commit d9c46a0939
3 changed files with 7 additions and 0 deletions

View file

@ -91,6 +91,7 @@ PHP if you have not done so prior to upgrading MediaWiki.
* (bug 26217) File size is now checked before uploading in HTML5 browsers
* CSS stylesheet MediaWiki:Noscript.css is now loaded for users with JavaScript
disabled (enclosed in the head in a <noscript> tag)
* Added UserGetLanguageObject hook to change the language used in $wgLang
=== Bug fixes in 1.18 ===
* (bug 23119) WikiError class and subclasses are now marked as deprecated

View file

@ -1818,6 +1818,10 @@ $user: User object
'UserGetImplicitGroups': Called in User::getImplicitGroups()
&$groups: List of implicit (automatically-assigned) groups
'UserGetLanguageObject': Called when getting user's interface language object
$user: User object
&$code: Langauge code that will be used to create the object
'UserGetReservedNames': allows to modify $wgReservedUsernames at run time
&$reservedUsernames: $wgReservedUsernames

View file

@ -157,6 +157,8 @@ class StubUserLang extends StubObject {
$code = $wgLanguageCode;
}
wfRunHooks( 'UserGetLanguageObject', array( $wgUser, &$code ) );
if( $code === $wgLanguageCode ) {
return $wgContLang;
} else {