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
* 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
}
return $s;
}
+
+ /**
+ * Take a list of strings and build a locale-friendly comma-separated
+ * list, using the local comma-separator message.
+ * @fixme Fix this so it can work for $wgContLang too
+ */
+ function commaList( $list ) {
+ return implode(
+ $list,
+ wfMsgExt( 'comma-separator', 'escapenoentities' ) );
+ }
/**
* Truncate a string to a specified length in bytes, appending an optional
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 );
}
/**