| Index: trunk/phase3/docs/hooks.txt |
| — | — | @@ -862,6 +862,14 @@ |
| 863 | 863 | $rev: the new revision |
| 864 | 864 | $baseID: the revision ID this was based off, if any |
| 865 | 865 | |
| | 866 | +'NormalizeMessageKey': Called before the software gets the text of a message |
| | 867 | + (stuff in the MediaWiki: namespace), useful for changing WHAT message gets displayed |
| | 868 | +&$key: the message being looked up. Change this to something else to change what message gets displayed (string) |
| | 869 | +&$useDB: whether or not to look up the message in the database (bool) |
| | 870 | +&$langCode: the language code to get the message for (string) - or - |
| | 871 | + whether to use the content language (true) or site language (false) (bool) |
| | 872 | +&$transform: whether or not to expand variables and templates in the message (bool) |
| | 873 | + |
| 866 | 874 | 'OpenSearchUrls': Called when constructing the OpenSearch description XML. |
| 867 | 875 | Hooks can alter or append to the array of URLs for search & suggestion formats. |
| 868 | 876 | &$urls: array of associative arrays with Url element attributes |
| Index: trunk/phase3/includes/GlobalFunctions.php |
| — | — | @@ -460,6 +460,8 @@ |
| 461 | 461 | function wfMsgGetKey( $key, $useDB, $langCode = false, $transform = true ) { |
| 462 | 462 | global $wgParser, $wgContLang, $wgMessageCache, $wgLang; |
| 463 | 463 | |
| | 464 | + wfRunHooks('NormalizeMessageKey', array(&$key, &$useDB, &$langCode, &$transform)); |
| | 465 | + |
| 464 | 466 | # If $wgMessageCache isn't initialised yet, try to return something sensible. |
| 465 | 467 | if( is_object( $wgMessageCache ) ) { |
| 466 | 468 | $message = $wgMessageCache->get( $key, $useDB, $langCode ); |
| Index: trunk/phase3/RELEASE-NOTES |
| — | — | @@ -182,8 +182,9 @@ |
| 183 | 183 | * Allow the search box, toolbox and languages box in the Monobook sidebar to be |
| 184 | 184 | moved around arbitrarily using special sections in [[MediaWiki:Sidebar]]: |
| 185 | 185 | SEARCH, TOOLBOX and LANGUAGES |
| 186 | | - |
| 187 | | - |
| | 186 | +* Add a new hook NormalizeMessageKey to allow extensions to replace messages before |
| | 187 | + the database is potentially queried |
| | 188 | + |
| 188 | 189 | === Bug fixes in 1.13 === |
| 189 | 190 | |
| 190 | 191 | * (bug 10677) Add link to the file description page on the shared repository |