A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Hooks/PageContentLanguage below:

Manual:Hooks/PageContentLanguage - MediaWiki

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

It was added in Title.php but is in content/ContentHandler.php since MediaWiki 1.21 .

For example, if you want to mark all pages in the namespace with index 200 (and its talk page 201) as being in French, use:

static function onPageContentLanguage( MediaWiki\Title\Title $title, &$pageLang, $userLang ) {
	if ( $title->inNamespaces( 200, 201 ) ) {
		$pageLang = Language::factory( 'fr' );
	}
}

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4