MediaWiki  master
ILanguageConverter.php
Go to the documentation of this file.
1 <?php
21 
28 interface ILanguageConverter {
29 
35  public function getVariants();
36 
48  public function getVariantFallbacks( $variant );
49 
54  public function getConvRuleTitle();
55 
60  public function getPreferredVariant();
61 
66  public function getDefaultVariant();
67 
77  public function validateVariant( $variant = null );
78 
84  public function getURLVariant();
85 
96  public function autoConvert( $text, $toVariant = false );
97 
107  public function translate( $text, $variant );
108 
115  public function autoConvertToAllVariants( $text );
116 
124  public function convertTitle( LinkTarget $linkTarget );
125 
133  public function convertNamespace( $index, $variant = null );
134 
153  public function convert( $text );
154 
164  public function convertTo( $text, $variant );
165 
177  public function findVariantLink( &$link, &$nt, $ignoreOtherCond = false );
178 
184  public function getExtraHashOptions();
185 
196  public function guessVariant( $text, $variant );
197 
206  public function markNoConversion( $text, $noParse = false );
207 
216  public function convertCategoryKey( $key );
217 
224  public function updateConversionTable( LinkTarget $linkTarget );
225 
233  public function hasVariants();
234 
245  public function hasVariant( $variant );
246 
255  public function convertHtml( $text );
256 }
ILanguageConverter\getURLVariant
getURLVariant()
Get the variant specified in the URL.
ILanguageConverter\translate
translate( $text, $variant)
Translate a string to a variant.
ILanguageConverter\findVariantLink
findVariantLink(&$link, &$nt, $ignoreOtherCond=false)
If a language supports multiple variants, it is possible that non-existing link in one variant actual...
ILanguageConverter\getDefaultVariant
getDefaultVariant()
This function would not be affected by user's settings.
ILanguageConverter\getConvRuleTitle
getConvRuleTitle()
Get the title produced by the conversion rule.
ILanguageConverter\validateVariant
validateVariant( $variant=null)
Validate the variant and return an appropriate strict internal variant code if one exists.
ILanguageConverter\convertTitle
convertTitle(LinkTarget $linkTarget)
Auto convert a LinkTarget object to a readable string in the preferred variant.
ILanguageConverter\convertTo
convertTo( $text, $variant)
Same as convert() except a extra parameter to custom variant.
ILanguageConverter\autoConvertToAllVariants
autoConvertToAllVariants( $text)
Call translate() to convert text to all valid variants.
ILanguageConverter\markNoConversion
markNoConversion( $text, $noParse=false)
Enclose a string with the "no conversion" tag.
ILanguageConverter\convertHtml
convertHtml( $text)
Perform output conversion on a string, and encode for safe HTML output.
ILanguageConverter\getVariants
getVariants()
Get all valid variants.
ILanguageConverter\hasVariant
hasVariant( $variant)
Strict check if the language has the specific variant.
ILanguageConverter\getPreferredVariant
getPreferredVariant()
Get preferred language variant.
ILanguageConverter
The shared interface for all language converters.
Definition: ILanguageConverter.php:28
ILanguageConverter\autoConvert
autoConvert( $text, $toVariant=false)
Dictionary-based conversion.
ILanguageConverter\hasVariants
hasVariants()
Check if this is a language with variants.
ILanguageConverter\convertNamespace
convertNamespace( $index, $variant=null)
Get the namespace display name in the preferred variant.
ILanguageConverter\getExtraHashOptions
getExtraHashOptions()
Returns language specific hash options.
ILanguageConverter\guessVariant
guessVariant( $text, $variant)
Guess if a text is written in a variant.
ILanguageConverter\convertCategoryKey
convertCategoryKey( $key)
Convert the sorting key for category links.
ILanguageConverter\updateConversionTable
updateConversionTable(LinkTarget $linkTarget)
Refresh the cache of conversion tables when MediaWiki:Conversiontable* is updated.
ILanguageConverter\getVariantFallbacks
getVariantFallbacks( $variant)
In case some variant is not defined in the markup, we need to have some fallback.
MediaWiki\Linker\LinkTarget
Definition: LinkTarget.php:26
ILanguageConverter\convert
convert( $text)
Convert text to different variants of a language.