function parserConvert($t, $p) {return $t;}
function getVariants() { return array( $this->mLang->getCode() ); }
function getPreferredVariant() {return $this->mLang->getCode(); }
- function findVariantLink(&$l, &$n) {}
+ function findVariantLink(&$l, &$n, $forTemplate = false) {}
function getExtraHashOptions() {return '';}
function getParsedTitle() {return '';}
function markNoConversion($text, $noParse=false) {return $text;}
}
}
+ /**
+ * Reduce memory usage
+ */
+ function __destruct() {
+ foreach ( $this as $name => $value ) {
+ unset( $this->$name );
+ }
+ }
+
/**
* Hook which will be called if this is the content language.
* Descendants can use this to register hook functions or modify globals
} else {
# Fall back to English if local list is incomplete
$magicWords =& Language::getMagicWords();
- if ( !isset($magicWords[$mw->mId]) ) { throw new MWException("Magic word not found" ); }
+ if ( !isset($magicWords[$mw->mId]) ) {
+ throw new MWException("Magic word '{$mw->mId}' not found" );
+ }
$rawEntry = $magicWords[$mw->mId];
}
}
* LanguageIs.php for the , => . and . => , implementation.
*
* @todo check if it's viable to use localeconv() for the decimal
- * seperator thing.
+ * separator thing.
* @param $number Mixed: the string to be formatted, should be an integer
* or a floating point number.
* @param $nocommafy Bool: set to true for special numbers like dates
if ( !count($forms) ) { return ''; }
$forms = $this->preConvertPlural( $forms, 2 );
- return ( abs($count) == 1 ) ? $forms[0] : $forms[1];
+ return ( $count == 1 ) ? $forms[0] : $forms[1];
}
/**
* @param $nt Mixed: the title object of the link
* @return null the input parameters may be modified upon return
*/
- function findVariantLink( &$link, &$nt ) {
- $this->mConverter->findVariantLink($link, $nt);
+ function findVariantLink( &$link, &$nt, $forTemplate = false ) {
+ $this->mConverter->findVariantLink($link, $nt, $forTemplate );
}
/**