* Added UserGetLanguageObject hook to change the language used in $wgLang
This commit is contained in:
parent
bb651b0063
commit
d9c46a0939
3 changed files with 7 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -157,6 +157,8 @@ class StubUserLang extends StubObject {
|
|||
$code = $wgLanguageCode;
|
||||
}
|
||||
|
||||
wfRunHooks( 'UserGetLanguageObject', array( $wgUser, &$code ) );
|
||||
|
||||
if( $code === $wgLanguageCode ) {
|
||||
return $wgContLang;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue