Manual:Hooks/Language::getMessagesFileName

From Linux Web Expert

Language::getMessagesFileName
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Use to change the path of a localisation file.
<translate> Define function:</translate>
public static function onLanguage_getMessagesFileName( $code, &$file ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"Language::getMessagesFileName": "MediaWiki\\Extension\\MyExtension\\Hooks::onLanguagegetMessagesFileName"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> ../languages/Language.php
<translate> Interface:</translate> Language__getMessagesFileNameHook.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:Language::getMessagesFileName extensions</tvar>.</translate>


Details

  • $code: The language code or the language we're looking for a messages file for
  • &$file: The messages file path, you can override this to change the location.