MediaWiki master
LanguageConverterIcu Class Reference

A class that extends LanguageConverterSpecific for converts that use ICU rule-based transliterators. More...

Inherits LanguageConverterSpecific.

Inherited by BanConverter.

Collaboration diagram for LanguageConverterIcu:

Public Member Functions

 icuTranslate ( $text, $variant)
 Translate a string to a variant using ICU transliterator.
 
 translate ( $text, $variant)
 
- Public Member Functions inherited from LanguageConverterSpecific
 findVariantLink (&$link, &$nt, $ignoreOtherCond=false)
 A function wrapper:
 

Protected Member Functions

 getIcuRules ()
 Get the array mapping variants to ICU transliteration rules.
 
 getTransliteratorAliases ()
 Get the array mapping variant aliases to the main variant.
 
 getTransliterators ()
 Get the array mapping variants to ICU transliterators.
 
 loadDefaultTables ()
 Creates empty tables.
 

Protected Attributes

Transliterator[] $mTransliterators
 

Detailed Description

A class that extends LanguageConverterSpecific for converts that use ICU rule-based transliterators.

Definition at line 27 of file LanguageConverterIcu.php.

Member Function Documentation

◆ getIcuRules()

LanguageConverterIcu::getIcuRules ( )
abstractprotected

Get the array mapping variants to ICU transliteration rules.

Subclasses must implement this.

Returns
string[]

Reimplemented in BanConverter.

◆ getTransliteratorAliases()

LanguageConverterIcu::getTransliteratorAliases ( )
protected

Get the array mapping variant aliases to the main variant.

Returns
string[]

Reimplemented in BanConverter.

Definition at line 97 of file LanguageConverterIcu.php.

◆ getTransliterators()

LanguageConverterIcu::getTransliterators ( )
protected

Get the array mapping variants to ICU transliterators.

Returns
Transliterator[]

Definition at line 79 of file LanguageConverterIcu.php.

◆ icuTranslate()

LanguageConverterIcu::icuTranslate ( $text,
$variant )

Translate a string to a variant using ICU transliterator.

Parameters
string$textText to convert
string$variantVariant language code
Returns
string Translated text

Definition at line 62 of file LanguageConverterIcu.php.

◆ loadDefaultTables()

LanguageConverterIcu::loadDefaultTables ( )
protected

Creates empty tables.

mTransliterators will be used instead.

Returns
array

Definition at line 39 of file LanguageConverterIcu.php.

◆ translate()

LanguageConverterIcu::translate ( $text,
$variant )

Definition at line 47 of file LanguageConverterIcu.php.

Member Data Documentation

◆ $mTransliterators

Transliterator [] LanguageConverterIcu::$mTransliterators
protected

Definition at line 32 of file LanguageConverterIcu.php.


The documentation for this class was generated from the following file: