MediaWiki master
LanguageConverterSpecific.php
Go to the documentation of this file.
1<?php
23
40 public function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
41 // check for user namespace
42 if ( is_object( $nt ) ) {
43 $ns = $nt->getNamespace();
44 if ( $ns === NS_USER || $ns === NS_USER_TALK ) {
45 return;
46 }
47 }
48
49 $oldlink = $link;
50 parent::findVariantLink( $link, $nt, $ignoreOtherCond );
51 if ( $this->getPreferredVariant() == $this->getMainCode() ) {
52 $link = $oldlink;
53 }
54 }
55}
const NS_USER
Definition Defines.php:67
const NS_USER_TALK
Definition Defines.php:68
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.
Represents a title within MediaWiki.
Definition Title.php:78