MediaWiki master
ILanguageConverter.php
Go to the documentation of this file.
1<?php
21namespace MediaWiki\Language;
22
26
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
281class_alias( ILanguageConverter::class, 'ILanguageConverter' );
Represents a title within MediaWiki.
Definition Title.php:78
The shared interface for all language converters.
convertHtml( $text)
Perform output conversion on a string, and encode for safe HTML output.
getExtraHashOptions()
Returns language specific hash options.
hasVariant( $variant)
Strict check if the language has the specific variant.
getConvRuleTitle()
Get the title produced by the conversion rule.
getURLVariant()
Get the variant specified in the URL.
convertCategoryKey( $key)
Convert the sorting key for category links.
hasVariants()
Check if this is a language with variants.
translate( $text, $variant)
Translate a string to a variant.
autoConvertToAllVariants( $text)
Call translate() to convert text to all valid variants.
convert( $text)
Convert text to different variants of a language.
validateVariant( $variant=null)
Validate the variant and return an appropriate strict internal variant code if one exists.
convertSplitTitle( $title)
Automatically converts a LinkTarget or PageReference to a readable string in the preferred variant,...
getPreferredVariant()
Get preferred language variant.
convertTitle( $title)
Automatically convert a LinkTarget or PageReference to a readable string in the preferred variant.
autoConvert( $text, $toVariant=false)
Dictionary-based conversion.
convertTo( $text, $variant, bool $clearState=true)
Same as convert() except a extra parameter to custom variant.
getVariantFallbacks( $variant)
In case some variant is not defined in the markup, we need to have some fallback.
guessVariant( $text, $variant)
Guess if a text is written in a variant.
updateConversionTable(LinkTarget $linkTarget)
Refresh the cache of conversion tables when MediaWiki:Conversiontable* is updated.
getDefaultVariant()
This function would not be affected by user's settings.
getVariants()
Get all valid variants.
findVariantLink(&$link, &$nt, $ignoreOtherCond=false)
If a language supports multiple variants, it is possible that non-existing link in one variant actual...
convertNamespace( $index, $variant=null)
Get the namespace display name in the preferred variant.
markNoConversion( $text, $noParse=false)
Enclose a string with the "no conversion" tag.
Represents the target of a wiki link.
Interface for objects (potentially) representing a page that can be viewable and linked to on a wiki.