Jump to content
MediaWiki

Manual:Hooks/MessageCache::get

From mediawiki.org
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

[edit ]

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

[edit ]

AltStyle によって変換されたページ (->オリジナル) /