var $mDescCodeSep = ':', $mDescVarSep = ';';
var $mUcfirst = false;
var $mHeaderVariant;
+ var $mConvRuleTitle = false;
const CACHE_VERSION_KEY = 'VERSION 6';
*/
function applyManualConv( $convRule ) {
// use syntax -{T|zh:TitleZh;zh-tw:TitleTw}- for custom
- // conversion in title
- $title = $convRule->getTitle();
+ // conversion in title
+ $this->mConvRuleTitle = $convRule->getTitle();
// apply manual conversion table to global table
$convTable = $convRule->getConvTable();
* @return string converted text
* @public
*/
- function convert( $text, $isTitle ) {
+ function convert( $text ) {
global $wgDisableLangConversion;
if ( $wgDisableLangConversion ) return $text;
// Remove the last delimiter (wasn't real)
$converted = substr( $converted, 0, - strlen( $this->mMarkup['end'] ) );
- if ( $isTitle ) {
- error_log("title2: $converted\n");
- $this->mConvertedTitle = $converted;
- }
return $converted;
}
* Parse rules conversion.
* @private
*/
- function getRuleConvertedStr( $variant, $doConvert ) {
+ function getRuleConvertedStr( $variant ) {
$bidtable = $this->mBidtable;
$unidtable = $this->mUnidtable;
if ( count( $bidtable ) + count( $unidtable ) == 0 ) {
return $this->mRules;
- } elseif ( $doConvert ) { // the text converted
+ } else {
// display current variant in bidirectional array
$disp = $this->getTextInBidtable( $variant );
// or display current variant in fallbacks
}
}
return $disp;
- } else { // no convert
- return $this->mRules;
}
}
// proces H,- flag or T only: output nothing
$this->mRuleDisplay = '';
} elseif ( in_array( 'S', $flags ) ) {
- // true hard-coded now since we shouldn't be called if we're not converting
- $this->mRuleDisplay = $this->getRuleConvertedStr( $variant, true );
+ $this->mRuleDisplay = $this->getRuleConvertedStr( $variant );
} else {
$this->mRuleDisplay = $this->mManualCodeError;
}
// process T flag
if ( in_array( 'T', $flags ) ) {
- // true hard-coded now since we shouldn't be called if we're not converting
- $this->mRuleTitle = $this->getRuleConvertedStr( $variant, true );
+ $this->mRuleTitle = $this->getRuleConvertedStr( $variant );
}
if ( in_array( '-', $flags ) ) {