MediaWiki
master
ILanguageConverter.php
Go to the documentation of this file.
1
<?php
21
namespace
MediaWiki\Language
;
22
23
use
MediaWiki\Linker\LinkTarget
;
24
use
MediaWiki\Page\PageReference
;
25
use
MediaWiki\Title\Title
;
26
33
interface
ILanguageConverter
{
34
40
public
function
getVariants
();
41
54
public
function
getVariantFallbacks
( $variant );
55
61
public
function
getConvRuleTitle
();
62
68
public
function
getPreferredVariant
();
69
75
public
function
getDefaultVariant
();
76
86
public
function
validateVariant
( $variant =
null
);
87
93
public
function
getURLVariant
();
94
105
public
function
autoConvert
( $text, $toVariant =
false
);
106
116
public
function
translate
( $text, $variant );
117
124
public
function
autoConvertToAllVariants
( $text );
125
135
public
function
convertSplitTitle
( $title );
136
144
public
function
convertTitle
( $title );
145
153
public
function
convertNamespace
( $index, $variant =
null
);
154
173
public
function
convert
( $text );
174
186
public
function
convertTo
( $text, $variant,
bool
$clearState =
true
);
187
199
public
function
findVariantLink
( &$link, &$nt, $ignoreOtherCond =
false
);
200
206
public
function
getExtraHashOptions
();
207
218
public
function
guessVariant
( $text, $variant );
219
228
public
function
markNoConversion
( $text, $noParse =
false
);
229
238
public
function
convertCategoryKey
( $key );
239
246
public
function
updateConversionTable
(
LinkTarget
$linkTarget );
247
255
public
function
hasVariants
();
256
267
public
function
hasVariant
( $variant );
268
277
public
function
convertHtml
( $text );
278
}
279
281
class_alias( ILanguageConverter::class,
'ILanguageConverter'
);
MediaWiki\Title\Title
Represents a title within MediaWiki.
Definition
Title.php:78
MediaWiki\Language\ILanguageConverter
The shared interface for all language converters.
Definition
ILanguageConverter.php:33
MediaWiki\Language\ILanguageConverter\convertHtml
convertHtml( $text)
Perform output conversion on a string, and encode for safe HTML output.
MediaWiki\Language\ILanguageConverter\getExtraHashOptions
getExtraHashOptions()
Returns language specific hash options.
MediaWiki\Language\ILanguageConverter\hasVariant
hasVariant( $variant)
Strict check if the language has the specific variant.
MediaWiki\Language\ILanguageConverter\getConvRuleTitle
getConvRuleTitle()
Get the title produced by the conversion rule.
MediaWiki\Language\ILanguageConverter\getURLVariant
getURLVariant()
Get the variant specified in the URL.
MediaWiki\Language\ILanguageConverter\convertCategoryKey
convertCategoryKey( $key)
Convert the sorting key for category links.
MediaWiki\Language\ILanguageConverter\hasVariants
hasVariants()
Check if this is a language with variants.
MediaWiki\Language\ILanguageConverter\translate
translate( $text, $variant)
Translate a string to a variant.
MediaWiki\Language\ILanguageConverter\autoConvertToAllVariants
autoConvertToAllVariants( $text)
Call translate() to convert text to all valid variants.
MediaWiki\Language\ILanguageConverter\convert
convert( $text)
Convert text to different variants of a language.
MediaWiki\Language\ILanguageConverter\validateVariant
validateVariant( $variant=null)
Validate the variant and return an appropriate strict internal variant code if one exists.
MediaWiki\Language\ILanguageConverter\convertSplitTitle
convertSplitTitle( $title)
Automatically converts a LinkTarget or PageReference to a readable string in the preferred variant,...
MediaWiki\Language\ILanguageConverter\getPreferredVariant
getPreferredVariant()
Get preferred language variant.
MediaWiki\Language\ILanguageConverter\convertTitle
convertTitle( $title)
Automatically convert a LinkTarget or PageReference to a readable string in the preferred variant.
MediaWiki\Language\ILanguageConverter\autoConvert
autoConvert( $text, $toVariant=false)
Dictionary-based conversion.
MediaWiki\Language\ILanguageConverter\convertTo
convertTo( $text, $variant, bool $clearState=true)
Same as convert() except a extra parameter to custom variant.
MediaWiki\Language\ILanguageConverter\getVariantFallbacks
getVariantFallbacks( $variant)
In case some variant is not defined in the markup, we need to have some fallback.
MediaWiki\Language\ILanguageConverter\guessVariant
guessVariant( $text, $variant)
Guess if a text is written in a variant.
MediaWiki\Language\ILanguageConverter\updateConversionTable
updateConversionTable(LinkTarget $linkTarget)
Refresh the cache of conversion tables when MediaWiki:Conversiontable* is updated.
MediaWiki\Language\ILanguageConverter\getDefaultVariant
getDefaultVariant()
This function would not be affected by user's settings.
MediaWiki\Language\ILanguageConverter\getVariants
getVariants()
Get all valid variants.
MediaWiki\Language\ILanguageConverter\findVariantLink
findVariantLink(&$link, &$nt, $ignoreOtherCond=false)
If a language supports multiple variants, it is possible that non-existing link in one variant actual...
MediaWiki\Language\ILanguageConverter\convertNamespace
convertNamespace( $index, $variant=null)
Get the namespace display name in the preferred variant.
MediaWiki\Language\ILanguageConverter\markNoConversion
markNoConversion( $text, $noParse=false)
Enclose a string with the "no conversion" tag.
MediaWiki\Linker\LinkTarget
Represents the target of a wiki link.
Definition
LinkTarget.php:33
MediaWiki\Page\PageReference
Interface for objects (potentially) representing a page that can be viewable and linked to on a wiki.
Definition
PageReference.php:52
MediaWiki\Language
Definition
ConverterRule.php:22
includes
language
ILanguageConverter.php
Generated on Sat Nov 2 2024 18:24:02 for MediaWiki by
1.10.0