MediaWiki
1.42.1
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:46
LanguageConverter\getPreferredVariant
getPreferredVariant()
Get preferred language variant.
Definition
LanguageConverter.php:275
LanguageConverter\getMainCode
getMainCode()
Get the language code with converter (the "main" language code).
MediaWiki\Title\Title
Represents a title within MediaWiki.
Definition
Title.php:78
includes
language
LanguageConverterSpecific.php
Generated on Thu Jun 27 2024 15:59:11 for MediaWiki by
1.10.0