MediaWiki master
ILanguageConverter.php
Go to the documentation of this file.
1<?php
7namespace MediaWiki\Language;
8
13
21
27 public function getVariants();
28
41 public function getVariantFallbacks( $variant );
42
48 public function getConvRuleTitle();
49
55 public function getPreferredVariant();
56
62 public function getDefaultVariant();
63
73 public function validateVariant( $variant = null );
74
80 public function getURLVariant();
81
92 public function autoConvert( $text, $toVariant = false );
93
103 public function translate( $text, $variant );
104
111 public function autoConvertToAllVariants( $text );
112
122 public function convertSplitTitle( $title );
123
131 public function convertTitle( $title );
132
140 public function convertNamespace( $index, $variant = null );
141
160 public function convert( $text );
161
173 public function convertTo( $text, $variant, bool $clearState = true );
174
186 public function findVariantLink( &$link, &$nt, $ignoreOtherCond = false );
187
193 public function getExtraHashOptions();
194
205 public function guessVariant( $text, $variant );
206
215 public function markNoConversion( $text, $noParse = false );
216
225 public function convertCategoryKey( $key );
226
233 public function updateConversionTable( PageIdentity $page );
234
242 public function hasVariants();
243
254 public function hasVariant( $variant );
255
264 public function convertHtml( $text );
265}
266
268class_alias( ILanguageConverter::class, 'ILanguageConverter' );
Represents a title within MediaWiki.
Definition Title.php:69
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.