MediaWiki  master
LanguageConverterSpecific.php
Go to the documentation of this file.
1 <?php
22 
39  public function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
40  // check for user namespace
41  if ( is_object( $nt ) ) {
42  $ns = $nt->getNamespace();
43  if ( $ns === NS_USER || $ns === NS_USER_TALK ) {
44  return;
45  }
46  }
47 
48  $oldlink = $link;
49  parent::findVariantLink( $link, $nt, $ignoreOtherCond );
50  if ( $this->getPreferredVariant() == $this->getMainCode() ) {
51  $link = $oldlink;
52  }
53  }
54 }
const NS_USER
Definition: Defines.php:66
const NS_USER_TALK
Definition: Defines.php:67
A class that extends LanguageConverter with specific behaviour.
findVariantLink(&$link, &$nt, $ignoreOtherCond=false)
A function wrapper:
Base class for multi-variant language conversion.
getPreferredVariant()
Get preferred language variant.
getMainCode()
Get the language code with converter (the "main" language code).
Represents a title within MediaWiki.
Definition: Title.php:76