Manual:Hooks/MessageCache::get
Appearance
From mediawiki.org
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Deprecated: This feature is deprecated and should no longer be used, however it is possibly still available for reasons of backwards compatibility . This feature was deprecated in version 1.41.0. See MessageCacheFetchOverrides for an alternative way to use this feature.
| MessageCache::get | |
|---|---|
| Available from version 1.23.0 (Gerrit change 98078) Allows changing a message key, to customize it before the translation is accessed | |
| Define function: | public static function onMessageCache_get( string &$lckey ) { ... } |
| Attach hook: | In extension.json:
{ "Hooks":{ "MessageCache::get":"MediaWiki\\Extension\\MyExtension\\Hooks::onMessageCacheget" } } |
| Called from: | File(s): includes/language/MessageCache.php |
| Interface: | MessageCache__getHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:MessageCache::get extensions.
Details
Both the input and output keys must have an initial lowercase character. No spaces can be used in the keys; any spaces must be converted to underscores.
- &$lckey - Message key to check and optionally customize
See also
- MessagesPreLoad hook
- MessageCacheFetchOverrides hook