Jump to content

Manual:Hooks/LanguageGetTranslatedLanguageNames

From mediawiki.org
LanguageGetTranslatedLanguageNames
Available from version 1.18.0 (r79359, codereview)
Provide translated language names.
Define function:
public static function onLanguageGetTranslatedLanguageNames( &$names, $code ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"LanguageGetTranslatedLanguageNames": "MediaWiki\\Extension\\MyExtension\\Hooks::onLanguageGetTranslatedLanguageNames"
	}
}
Called from: File(s): ../languages/Language.php
Interface: LanguageGetTranslatedLanguageNamesHook.php

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


Details

[edit]
  • &$names: array of language code => language name
  • $code: preferred language of the translations