MediaWiki master
MediaWiki\Language\ConverterRule Class Reference

The rules used for language conversion, this processes the rules extracted by Parser from the -{ }- wikitext syntax. More...

Collaboration diagram for MediaWiki\Language\ConverterRule:

Public Member Functions

 __construct ( $text, LanguageConverter $converter)
 
 getConvTable ()
 Get conversion table.
 
 getDisplay ()
 Get display text on markup -{...}-.
 
 getFlags ()
 Get conversion flags.
 
 getRules ()
 Get conversion rules string.
 
 getRulesAction ()
 Return how to deal with conversion rules.
 
 getTextInBidtable ( $variants)
 Check if the variant array is in the convert array.
 
 getTitle ()
 Get converted title.
 
 hasRules ()
 Checks if there are conversion rules.
 
 parse ( $variant=null)
 Parse rules and flags.
 

Public Attributes

array $mBidtable = []
 of the translation in each variant
 
LanguageConverter $mConverter
 
array $mConvTable = []
 
array $mFlags = []
 
string false $mRuleDisplay = ''
 
string $mRules = ''
 the text of the rules
 
string $mRulesAction = 'none'
 
string false $mRuleTitle = false
 
string $mText
 original text in -{text}-
 
array $mUnidtable = []
 of the translation in each variant
 
array $mVariantFlags = []
 

Detailed Description

The rules used for language conversion, this processes the rules extracted by Parser from the -{ }- wikitext syntax.

Definition at line 33 of file ConverterRule.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Language\ConverterRule::__construct ( $text,
LanguageConverter $converter )
Parameters
string$textThe text between -{ and }-
LanguageConverter$converter

Definition at line 71 of file ConverterRule.php.

Member Function Documentation

◆ getConvTable()

MediaWiki\Language\ConverterRule::getConvTable ( )

Get conversion table.

(bidirectional and unidirectional conversion table)

Returns
array

Definition at line 516 of file ConverterRule.php.

References MediaWiki\Language\ConverterRule\$mConvTable.

Referenced by MediaWiki\Language\LanguageConverter\applyManualConv().

◆ getDisplay()

MediaWiki\Language\ConverterRule::getDisplay ( )

Get display text on markup -{...}-.

Returns
string

Definition at line 491 of file ConverterRule.php.

References MediaWiki\Language\ConverterRule\$mRuleDisplay.

◆ getFlags()

MediaWiki\Language\ConverterRule::getFlags ( )

Get conversion flags.

Returns
array

Definition at line 532 of file ConverterRule.php.

References MediaWiki\Language\ConverterRule\$mFlags.

◆ getRules()

MediaWiki\Language\ConverterRule::getRules ( )

Get conversion rules string.

Returns
string

Definition at line 524 of file ConverterRule.php.

References MediaWiki\Language\ConverterRule\$mRules.

◆ getRulesAction()

MediaWiki\Language\ConverterRule::getRulesAction ( )

Return how to deal with conversion rules.

Returns
string

Definition at line 507 of file ConverterRule.php.

References MediaWiki\Language\ConverterRule\$mRulesAction.

Referenced by MediaWiki\Language\LanguageConverter\applyManualConv().

◆ getTextInBidtable()

MediaWiki\Language\ConverterRule::getTextInBidtable ( $variants)

Check if the variant array is in the convert array.

Parameters
array | string$variantsVariant language code
Returns
string|false Translated text

Definition at line 82 of file ConverterRule.php.

◆ getTitle()

MediaWiki\Language\ConverterRule::getTitle ( )

Get converted title.

Returns
string|false

Definition at line 499 of file ConverterRule.php.

References MediaWiki\Language\ConverterRule\$mRuleTitle.

Referenced by MediaWiki\Language\LanguageConverter\applyManualConv().

◆ hasRules()

MediaWiki\Language\ConverterRule::hasRules ( )

Checks if there are conversion rules.

Returns
bool

Definition at line 483 of file ConverterRule.php.

◆ parse()

MediaWiki\Language\ConverterRule::parse ( $variant = null)

Parse rules and flags.

Parameters
string | null$variantVariant language code

Definition at line 374 of file ConverterRule.php.

References MediaWiki\Language\ConverterRule\$mFlags, MediaWiki\Language\ConverterRule\$mRules, and wfMessage().

Member Data Documentation

◆ $mBidtable

array MediaWiki\Language\ConverterRule::$mBidtable = []

of the translation in each variant

Definition at line 61 of file ConverterRule.php.

◆ $mConverter

LanguageConverter MediaWiki\Language\ConverterRule::$mConverter

Definition at line 41 of file ConverterRule.php.

◆ $mConvTable

array MediaWiki\Language\ConverterRule::$mConvTable = []

Definition at line 57 of file ConverterRule.php.

Referenced by MediaWiki\Language\ConverterRule\getConvTable().

◆ $mFlags

array MediaWiki\Language\ConverterRule::$mFlags = []

◆ $mRuleDisplay

string false MediaWiki\Language\ConverterRule::$mRuleDisplay = ''

Definition at line 43 of file ConverterRule.php.

Referenced by MediaWiki\Language\ConverterRule\getDisplay().

◆ $mRules

string MediaWiki\Language\ConverterRule::$mRules = ''

the text of the rules

Definition at line 49 of file ConverterRule.php.

Referenced by MediaWiki\Language\ConverterRule\getRules(), and MediaWiki\Language\ConverterRule\parse().

◆ $mRulesAction

string MediaWiki\Language\ConverterRule::$mRulesAction = 'none'

Definition at line 51 of file ConverterRule.php.

Referenced by MediaWiki\Language\ConverterRule\getRulesAction().

◆ $mRuleTitle

string false MediaWiki\Language\ConverterRule::$mRuleTitle = false

Definition at line 45 of file ConverterRule.php.

Referenced by MediaWiki\Language\ConverterRule\getTitle().

◆ $mText

string MediaWiki\Language\ConverterRule::$mText

original text in -{text}-

Definition at line 37 of file ConverterRule.php.

◆ $mUnidtable

array MediaWiki\Language\ConverterRule::$mUnidtable = []

of the translation in each variant

Definition at line 65 of file ConverterRule.php.

◆ $mVariantFlags

array MediaWiki\Language\ConverterRule::$mVariantFlags = []

Definition at line 55 of file ConverterRule.php.


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