Manual:Hooks/LanguageGetSpecialPageAliases

From Linux Web Expert

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.
LanguageGetSpecialPageAliases
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
<translate> Removed in <tvar name=1><translate> version <tvar (Gerrit change 439793)</tvar></translate>
Use to define aliases of special pages names depending of the language.
<translate> Define function:</translate>
public static function onLanguageGetSpecialPageAliases( &$specialPageAliases, $langCode ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"LanguageGetSpecialPageAliases": "MediaWiki\\Extension\\MyExtension\\Hooks::onLanguageGetSpecialPageAliases"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> ../languages/Language.php
<translate> Interface:</translate> LanguageGetSpecialPageAliasesHook.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:LanguageGetSpecialPageAliases extensions</tvar>.</translate>


Details

In 1.9, 1.10 and 1.11, this was misspelled LangugeGetSpecialPageAliases (missing the letter "a" in "Language").
From 1.13 to 1.15, you can use $wgExtensionAliasesFiles .
  • $specialPageAliases: associative array of magic words synonyms
  • $lang: language code (string)