MediaWiki REL1_31
FakeConverter.php
Go to the documentation of this file.
1<?php
38 public $mLang;
39
40 function __construct( $langobj ) {
41 $this->mLang = $langobj;
42 }
43
44 function autoConvert( $text, $variant = false ) {
45 return $text;
46 }
47
48 function autoConvertToAllVariants( $text ) {
49 return [ $this->mLang->getCode() => $text ];
50 }
51
52 function convert( $t ) {
53 return $t;
54 }
55
56 function convertTo( $text, $variant ) {
57 return $text;
58 }
59
64 function convertTitle( $t ) {
65 return $t->getPrefixedText();
66 }
67
68 function convertNamespace( $ns ) {
69 return $this->mLang->getFormattedNsText( $ns );
70 }
71
75 function getVariants() {
76 return [ $this->mLang->getCode() ];
77 }
78
79 function getVariantFallbacks( $variant ) {
80 return $this->mLang->getCode();
81 }
82
84 return $this->mLang->getCode();
85 }
86
87 function getDefaultVariant() {
88 return $this->mLang->getCode();
89 }
90
91 function getURLVariant() {
92 return '';
93 }
94
95 function getConvRuleTitle() {
96 return false;
97 }
98
99 function findVariantLink( &$l, &$n, $ignoreOtherCond = false ) {
100 }
101
103 return '';
104 }
105
106 function getParsedTitle() {
107 return '';
108 }
109
110 function markNoConversion( $text, $noParse = false ) {
111 return $text;
112 }
113
114 function convertCategoryKey( $key ) {
115 return $key;
116 }
117
118 function validateVariant( $variant = null ) {
119 return $variant === $this->mLang->getCode() ? $variant : null;
120 }
121
122 function translate( $text, $variant ) {
123 return $text;
124 }
125
126 public function updateConversionTable( Title $title ) {
127 }
128
134 private function reloadTables() {
135 }
136}
A fake language variant converter.
validateVariant( $variant=null)
getVariantFallbacks( $variant)
convertCategoryKey( $key)
autoConvert( $text, $variant=false)
markNoConversion( $text, $noParse=false)
translate( $text, $variant)
convertTo( $text, $variant)
reloadTables()
Used by test suites which need to reset the converter state.
__construct( $langobj)
updateConversionTable(Title $title)
autoConvertToAllVariants( $text)
findVariantLink(&$l, &$n, $ignoreOtherCond=false)
Internationalisation code.
Definition Language.php:35
Represents a title within MediaWiki.
Definition Title.php:39