Manual:Hooks/NormalizeMessageKey

Category:MediaWiki hooks#NormalizeMessageKey Category:Hooks added in MediaWiki 1.13.0#NormalizeMessageKey Category:MediaWiki deprecated or obsolete features#NormalizeMessageKey Category:Hooks removed in MediaWiki 1.27.0#NormalizeMessageKey
NormalizeMessageKey
Available from version 1.13.0
Removed in version 1.27.0Category:Removed hooks#NormalizeMessageKey
Allows extensions to change what system message will be displayed on a page
Define function:
public static function onNormalizeMessageKey( &$key, &$useDB, &$langCode, &$transform ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"NormalizeMessageKey": "MediaWiki\\Extension\\MyExtension\\Hooks::onNormalizeMessageKey"
	}
}
Called from: File(s): GlobalFunctions.phpCategory:MediaWiki hooks included in GlobalFunctions.php#NormalizeMessageKey
Interface: NormalizeMessageKeyHook.php

For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:NormalizeMessageKey extensions.

Details

  • &$key: (string) The message going to be displayed. Change this to display a different message in its place
  • &$useDB: (bool) Whether to query the database to get the message
  • &$langCode: (string or bool) If a string, the language code that should be used to get the message, if bool true, uses the content language, if bool false, uses the site's default language
  • &$transform: (bool) Whether to expand templates and variables in the message

See also

Category:Hooks added in MediaWiki 1.13.0 Category:Hooks removed in MediaWiki 1.27.0 Category:MediaWiki deprecated or obsolete features Category:MediaWiki hooks Category:MediaWiki hooks included in GlobalFunctions.php Category:Removed hooks