class FakeConverter {
var $mLang;
function FakeConverter($langobj) {$this->mLang = $langobj;}
- function convert($t, $i, $v) {return $t;}
+ function autoConvertToAllVariants($text) {return $text;}
+ function convert($t, $i) {return $t;}
function parserConvert($t, $p) {return $t;}
function getVariants() { return array( $this->mLang->getCode() ); }
function getPreferredVariant() {return $this->mLang->getCode(); }
function convertCategoryKey( $key ) {return $key; }
function convertLinkToAllVariants($text){ return array( $this->mLang->getCode() => $text); }
function armourMath($text){ return $text; }
- function groupConvert($group) {return '';}
}
/**
# Months and days are identical
$gy_offset = $gy - 1911;
} else if (!strcmp($cName,'tenno')) {
- # Minguo dates up to Showa period
+ # Nengō dates up to Meiji period
# Deduct years from the Gregorian calendar
# depending on the nengo periods
# Months and days are identical
- if (($gy < 1989) || (($gy == 1989) && ($gm == 1) && ($gd < 8))) {
+ if (($gy < 1912) || (($gy == 1912) && ($gm < 7)) || (($gy == 1912) && ($gm == 7) && ($gd < 31))) {
+ # Meiji period
+ $gy_gannen = $gy - 1868 + 1;
+ $gy_offset = $gy_gannen;
+ if ($gy_gannen == 1)
+ $gy_offset = '元';
+ $gy_offset = '明治'.$gy_offset;
+ } else if ((($gy == 1912) && ($gm == 7) && ($gd == 31)) || (($gy == 1912) && ($gm >= 8)) || (($gy > 1912) && ($gy < 1926)) || (($gy == 1926) && ($gm < 12)) || (($gy == 1926) && ($gm == 12) && ($gd < 26))) {
+ # Taishō period
+ $gy_gannen = $gy - 1912 + 1;
+ $gy_offset = $gy_gannen;
+ if ($gy_gannen == 1)
+ $gy_offset = '元';
+ $gy_offset = '大正'.$gy_offset;
+ } else if ((($gy == 1926) && ($gm == 12) && ($gd >= 26)) || (($gy > 1926) && ($gy < 1989)) || (($gy == 1989) && ($gm == 1) && ($gd < 8))) {
# Shōwa period
$gy_gannen = $gy - 1926 + 1;
$gy_offset = $gy_gannen;
function commaList( $list ) {
return implode(
$list,
- wfMsgExt( 'comma-separator', array( 'escapenoentities', 'language' => $this ) ) );
+ wfMsgExt( 'comma-separator', array( 'parsemag', 'escapenoentities', 'language' => $this ) ) );
}
/**
function semicolonList( $list ) {
return implode(
$list,
- wfMsgExt( 'semicolon-separator', array( 'escapenoentities', 'language' => $this ) ) );
+ wfMsgExt( 'semicolon-separator', array( 'parsemag', 'escapenoentities', 'language' => $this ) ) );
}
/**
return $text;
}
+ # convert text to all supported variants
+ function autoConvertToAllVariants($text) {
+ return $this->mConverter->autoConvertToAllVariants($text);
+ }
+
# convert text to different variants of a language.
- function convert( $text, $isTitle = false, $variant = null ) {
- return $this->mConverter->convert($text, $isTitle, $variant);
+ function convert( $text, $isTitle = false) {
+ return $this->mConverter->convert($text, $isTitle);
}
# Convert text from within Parser
function markNoConversion( $text, $noParse=false ) {
return $this->mConverter->markNoConversion( $text, $noParse );
}
-
- /**
- * Callback function for magicword 'groupconvert'
- *
- * @param string $group: the group name called for
- * @return blank string
- */
- function groupConvert( $group ) {
- return $this->mConverter->groupConvert( $group );
- }
/**
* A regular expression to match legal word-trailing characters