MediaWiki REL1_37
|
The rules used for language conversion, this processes the rules extracted by Parser from the -{ }-
wikitext syntax.
More...
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 deal with conversion rules. | |
getTextInBidtable ( $variants) | |
Check if variants array in 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 |
$mConvTable = [] | |
$mFlags = [] | |
$mRuleDisplay = '' | |
string | $mRules = '' |
the text of the rules | |
$mRulesAction = 'none' | |
$mRuleTitle = false | |
string | $mText |
original text in -{text}- | |
array | $mUnidtable = [] |
of the translation in each variant | |
$mVariantFlags = [] | |
Private Member Functions | |
generateConvTable () | |
Generate conversion table for all text. | |
getRuleConvertedStr ( $variant) | |
Parse rules conversion. | |
getRuleConvertedTitle ( $variant) | |
Similar to getRuleConvertedStr(), but this prefers to use original page title if $variant === $this->mConverter->getMainCode() and may return false in this case (so this title conversion rule will be ignored and the original title is shown). | |
getRulesDesc () | |
parseFlags () | |
Parse flags with syntax -{FLAG| ... }-. | |
parseRules () | |
Generate conversion table. | |
The rules used for language conversion, this processes the rules extracted by Parser from the -{ }-
wikitext syntax.
Definition at line 28 of file ConverterRule.php.
ConverterRule::__construct | ( | $text, | |
LanguageConverter | $converter | ||
) |
string | $text | The text between -{ and }- |
LanguageConverter | $converter |
Definition at line 60 of file ConverterRule.php.
|
private |
Generate conversion table for all text.
Definition at line 292 of file ConverterRule.php.
References $mBidtable, $mUnidtable, and getTextInBidtable().
Referenced by parse().
ConverterRule::getConvTable | ( | ) |
Get conversion table.
(bidirectional and unidirectional conversion table)
Definition at line 492 of file ConverterRule.php.
References $mConvTable.
Referenced by LanguageConverter\applyManualConv().
ConverterRule::getDisplay | ( | ) |
Get display text on markup -{...}-.
Definition at line 467 of file ConverterRule.php.
References $mRuleDisplay.
ConverterRule::getFlags | ( | ) |
Get conversion flags.
Definition at line 508 of file ConverterRule.php.
References $mFlags.
|
private |
Parse rules conversion.
string | $variant |
Definition at line 228 of file ConverterRule.php.
References $mBidtable, $mRules, $mUnidtable, and getTextInBidtable().
Referenced by getRuleConvertedTitle(), and parse().
|
private |
Similar to getRuleConvertedStr(), but this prefers to use original page title if $variant === $this->mConverter->getMainCode() and may return false in this case (so this title conversion rule will be ignored and the original title is shown).
string | $variant | The variant code to display page title in |
Definition at line 269 of file ConverterRule.php.
References getRuleConvertedStr(), and getTextInBidtable().
Referenced by parse().
ConverterRule::getRules | ( | ) |
Get conversion rules string.
Definition at line 500 of file ConverterRule.php.
References $mRules.
ConverterRule::getRulesAction | ( | ) |
Return how deal with conversion rules.
Definition at line 483 of file ConverterRule.php.
References $mRulesAction.
Referenced by LanguageConverter\applyManualConv().
|
private |
ConverterRule::getTextInBidtable | ( | $variants | ) |
Check if variants array in convert array.
array | string | $variants | Variant language code |
Definition at line 71 of file ConverterRule.php.
Referenced by generateConvTable(), getRuleConvertedStr(), and getRuleConvertedTitle().
ConverterRule::getTitle | ( | ) |
Get converted title.
Definition at line 475 of file ConverterRule.php.
References $mRuleTitle.
Referenced by LanguageConverter\applyManualConv().
ConverterRule::hasRules | ( | ) |
ConverterRule::parse | ( | $variant = null | ) |
Parse rules and flags.
string | null | $variant | Variant language code |
Definition at line 350 of file ConverterRule.php.
References $mFlags, $mRules, generateConvTable(), getRuleConvertedStr(), getRuleConvertedTitle(), getRulesDesc(), parseFlags(), parseRules(), true, and wfMessage().
|
private |
Parse flags with syntax -{FLAG| ... }-.
Definition at line 87 of file ConverterRule.php.
References $mText, StringUtils\explode(), and true.
Referenced by parse().
|
private |
Generate conversion table.
Definition at line 152 of file ConverterRule.php.
References $mRules.
Referenced by parse().
array ConverterRule::$mBidtable = [] |
of the translation in each variant
Definition at line 50 of file ConverterRule.php.
Referenced by generateConvTable(), and getRuleConvertedStr().
LanguageConverter ConverterRule::$mConverter |
Definition at line 36 of file ConverterRule.php.
ConverterRule::$mConvTable = [] |
Definition at line 46 of file ConverterRule.php.
Referenced by getConvTable().
ConverterRule::$mFlags = [] |
Definition at line 44 of file ConverterRule.php.
Referenced by getFlags(), and parse().
ConverterRule::$mRuleDisplay = '' |
Definition at line 37 of file ConverterRule.php.
Referenced by getDisplay().
string ConverterRule::$mRules = '' |
the text of the rules
Definition at line 42 of file ConverterRule.php.
Referenced by getRuleConvertedStr(), getRules(), parse(), and parseRules().
ConverterRule::$mRulesAction = 'none' |
Definition at line 43 of file ConverterRule.php.
Referenced by getRulesAction().
ConverterRule::$mRuleTitle = false |
Definition at line 38 of file ConverterRule.php.
Referenced by getTitle().
string ConverterRule::$mText |
original text in -{text}-
Definition at line 32 of file ConverterRule.php.
Referenced by parseFlags().
array ConverterRule::$mUnidtable = [] |
of the translation in each variant
Definition at line 54 of file ConverterRule.php.
Referenced by generateConvTable(), and getRuleConvertedStr().
ConverterRule::$mVariantFlags = [] |
Definition at line 45 of file ConverterRule.php.