MediaWiki master
LanguageConverterSpecific.php
Go to the documentation of this file.
1<?php
9
26 public function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
27 // check for user namespace
28 if ( is_object( $nt ) ) {
29 $ns = $nt->getNamespace();
30 if ( $ns === NS_USER || $ns === NS_USER_TALK ) {
31 return;
32 }
33 }
34
35 $oldlink = $link;
36 parent::findVariantLink( $link, $nt, $ignoreOtherCond );
37 if ( $this->getPreferredVariant() == $this->getMainCode() ) {
38 $link = $oldlink;
39 }
40 }
41}
const NS_USER
Definition Defines.php:53
const NS_USER_TALK
Definition Defines.php:54
A class that extends LanguageConverter with specific behaviour.
findVariantLink(&$link, &$nt, $ignoreOtherCond=false)
A function wrapper:
Base class for multi-variant language conversion.
getMainCode()
Get the language code with converter (the "main" language code).
getPreferredVariant()
Get preferred language variant.string The preferred language code
Represents a title within MediaWiki.
Definition Title.php:69