MediaWiki
REL1_41
LanguageConverterSpecific.php
Go to the documentation of this file.
1
<?php
21
use
MediaWiki\Title\Title
;
22
28
abstract
class
LanguageConverterSpecific
extends
LanguageConverter
{
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
}
NS_USER
const NS_USER
Definition
Defines.php:66
NS_USER_TALK
const NS_USER_TALK
Definition
Defines.php:67
LanguageConverterSpecific
A class that extends LanguageConverter with specific behaviour.
Definition
LanguageConverterSpecific.php:28
LanguageConverterSpecific\findVariantLink
findVariantLink(&$link, &$nt, $ignoreOtherCond=false)
A function wrapper:
Definition
LanguageConverterSpecific.php:39
LanguageConverter
Base class for multi-variant language conversion.
Definition
LanguageConverter.php:44
LanguageConverter\getPreferredVariant
getPreferredVariant()
Get preferred language variant.
Definition
LanguageConverter.php:312
LanguageConverter\getMainCode
getMainCode()
Get the language code with converter (the "main" language code).
MediaWiki\Title\Title
Represents a title within MediaWiki.
Definition
Title.php:76
includes
language
LanguageConverterSpecific.php
Generated on Wed Nov 27 2024 07:23:40 for MediaWiki by
1.10.0