Manual:Hooks/MessageCache::get
From Linux Web Expert
File:OOjs UI icon alert-destructive.svg | <translate>
This deprecated feature should no longer be used, but is still available for reasons of backwards compatibility. This feature was deprecated in version <tvar name=ver>1.41.0</tvar>.</translate> <translate> Please see <tvar name=page>MessageCacheFetchOverrides</tvar> for an alternative way to use this feature.</translate> |
MessageCache::get | |
---|---|
<translate> Available from <tvar name=1><translate> version <tvar (Gerrit change 98078)</tvar></translate> Allows changing a message key, to customize it before the translation is accessed | |
<translate> Define function:</translate> | public static function onMessageCache_get( string &$lckey ) { ... }
|
<translate> Attach hook:</translate> | <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
"Hooks": {
"MessageCache::get": "MediaWiki\\Extension\\MyExtension\\Hooks::onMessageCacheget"
}
}
|
<translate> Called from:</translate> | <translate> File(s):</translate> includes/language/MessageCache.php |
<translate> Interface:</translate> | MessageCache__getHook.php |
<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:MessageCache::get extensions</tvar>.</translate>
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