http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83405
Revision: 83405 Author: ialex Date: 2011-03-06 21:05:18 +0000 (Sun, 06 Mar 2011) Log Message: ----------- * Added UserGetLanguageObject hook to change the language used in $wgLang Modified Paths: -------------- trunk/phase3/RELEASE-NOTES trunk/phase3/docs/hooks.txt trunk/phase3/includes/StubObject.php Modified: trunk/phase3/RELEASE-NOTES =================================================================== --- trunk/phase3/RELEASE-NOTES 2011-03-06 21:01:54 UTC (rev 83404) +++ trunk/phase3/RELEASE-NOTES 2011-03-06 21:05:18 UTC (rev 83405) @@ -91,6 +91,7 @@ * (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 Modified: trunk/phase3/docs/hooks.txt =================================================================== --- trunk/phase3/docs/hooks.txt 2011-03-06 21:01:54 UTC (rev 83404) +++ trunk/phase3/docs/hooks.txt 2011-03-06 21:05:18 UTC (rev 83405) @@ -1818,6 +1818,10 @@ '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 Modified: trunk/phase3/includes/StubObject.php =================================================================== --- trunk/phase3/includes/StubObject.php 2011-03-06 21:01:54 UTC (rev 83404) +++ trunk/phase3/includes/StubObject.php 2011-03-06 21:05:18 UTC (rev 83405) @@ -157,6 +157,8 @@ $code = $wgLanguageCode; } + wfRunHooks( 'UserGetLanguageObject', array( $wgUser, &$code ) ); + if( $code === $wgLanguageCode ) { return $wgContLang; } else { _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs