MediaWiki master
ILanguageConverter.php
Go to the documentation of this file.
1<?php
21namespace MediaWiki\Language;
22
27
35
41 public function getVariants();
42
55 public function getVariantFallbacks( $variant );
56
62 public function getConvRuleTitle();
63
69 public function getPreferredVariant();
70
76 public function getDefaultVariant();
77
87 public function validateVariant( $variant = null );
88
94 public function getURLVariant();
95
106 public function autoConvert( $text, $toVariant = false );
107
117 public function translate( $text, $variant );
118
125 public function autoConvertToAllVariants( $text );
126
136 public function convertSplitTitle( $title );
137
145 public function convertTitle( $title );
146
154 public function convertNamespace( $index, $variant = null );
155
174 public function convert( $text );
175
187 public function convertTo( $text, $variant, bool $clearState = true );
188
200 public function findVariantLink( &$link, &$nt, $ignoreOtherCond = false );
201
207 public function getExtraHashOptions();
208
219 public function guessVariant( $text, $variant );
220
229 public function markNoConversion( $text, $noParse = false );
230
239 public function convertCategoryKey( $key );
240
247 public function updateConversionTable( PageIdentity $page );
248
256 public function hasVariants();
257
268 public function hasVariant( $variant );
269
278 public function convertHtml( $text );
279}
280
282class_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.
updateConversionTable(PageIdentity $page)
Refresh the cache of conversion tables when MediaWiki:Conversiontable* is updated.
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.
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 an editable wiki page.
Interface for objects (potentially) representing a page that can be viewable and linked to on a wiki.