r83405 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83404‎ | r83405 | r83406 >
Date:21:05, 6 March 2011
Author:ialex
Status:ok (Comments)
Tags:
Comment:
* Added UserGetLanguageObject hook to change the language used in $wgLang
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/StubObject.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -1818,6 +1818,10 @@
18191819 'UserGetImplicitGroups': Called in User::getImplicitGroups()
18201820 &$groups: List of implicit (automatically-assigned) groups
18211821
 1822+'UserGetLanguageObject': Called when getting user's interface language object
 1823+$user: User object
 1824+&$code: Langauge code that will be used to create the object
 1825+
18221826 'UserGetReservedNames': allows to modify $wgReservedUsernames at run time
18231827 &$reservedUsernames: $wgReservedUsernames
18241828
Index: trunk/phase3/includes/StubObject.php
@@ -157,6 +157,8 @@
158158 $code = $wgLanguageCode;
159159 }
160160
 161+ wfRunHooks( 'UserGetLanguageObject', array( $wgUser, &$code ) );
 162+
161163 if( $code === $wgLanguageCode ) {
162164 return $wgContLang;
163165 } else {
Index: trunk/phase3/RELEASE-NOTES
@@ -91,6 +91,7 @@
9292 * (bug 26217) File size is now checked before uploading in HTML5 browsers
9393 * CSS stylesheet MediaWiki:Noscript.css is now loaded for users with JavaScript
9494 disabled (enclosed in the head in a <noscript> tag)
 95+* Added UserGetLanguageObject hook to change the language used in $wgLang
9596
9697 === Bug fixes in 1.18 ===
9798 * (bug 23119) WikiError class and subclasses are now marked as deprecated

Sign-offs

UserFlagDate
Hasharinspected21:25, 6 March 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   21:59, 15 June 2011

Use case?

#Comment by IAlex (talk | contribs)   06:47, 16 June 2011

Status & tagging log