* @return string
*/
function getVariantname( $code ) {
- return wfMsg( "variantname-$code" );
+ return $this->getMessageFromDB( "variantname-$code" );
}
function specialPage( $name ) {
return $this->dateFormats;
}
+ function getDefaultDateFormat() {
+ $this->load();
+ return $this->defaultDateFormat;
+ }
+
function getDatePreferenceMigrationMap() {
$this->load();
return $this->datePreferenceMigrationMap;
}
function getUserToggle( $tog ) {
- return wfMsg( "tog-$tog" );
+ return $this->getMessageFromDB( "tog-$tog" );
}
/**
}
/**
- * Ugly hack to get a message maybe from the MediaWiki namespace, if this
- * language object is the content or user language.
+ * Ugly hack to get a message maybe from the MediaWiki namespace, if this
+ * language object is the content or user language.
*/
function getMessageFromDB( $msg ) {
global $wgContLang, $wgLang;
}
function isMultibyte( $str ) {
- return (bool)preg_match( '/^[\x80-\xff]/', $str );
+ return (bool)preg_match( '/[\x80-\xff]/', $str );
}
function checkTitleEncoding( $s ) {
*
* @return string
*/
- function getDirMark() { return $this->isRTL() ? "\xE2\x80\x8F" : "\xE2\x80\x8E"; }
+ function getDirMark() {
+ return $this->isRTL() ? "\xE2\x80\x8F" : "\xE2\x80\x8E";
+ }
+
+ /**
+ * An arrow, depending on the language direction
+ *
+ * @return string
+ */
+ function getArrow() {
+ return $this->isRTL() ? '←' : '→';
+ }
/**
* To allow "foo[[bar]]" to extend the link over the whole word "foobar"
*
* @return bool
*/
- function linkPrefixExtension() {
+ function linkPrefixExtension() {
$this->load();
- return $this->linkPrefixExtension;
+ return $this->linkPrefixExtension;
}
function &getMagicWords() {
if ($i == $m) {
$s = $l[$i];
} else if ($i == $m - 1) {
- $s = $l[$i] . ' ' . wfMsg('and') . ' ' . $s;
+ $s = $l[$i] . ' ' . $this->getMessageFromDB( 'and' ) . ' ' . $s;
} else {
$s = $l[$i] . ', ' . $s;
}
*/
function translateBlockExpiry( $str ) {
- $scBlockExpiryOptions = wfMsg( 'ipboptions' );
+ $scBlockExpiryOptions = $this->getMessageFromDB( 'ipboptions' );
if ( $scBlockExpiryOptions == '-') {
return $str;
throw new MWException( "Error: Circular fallback reference in language code $code" );
}
$recursionGuard[$code] = true;
- $newDeps = self::loadLocalisation( $fallback );
+ $newDeps = self::loadLocalisation( $fallback, $disableCache );
unset( $recursionGuard[$code] );
$secondary = self::$mLocalisationCache[$fallback];
return self::$mLocalisationCache[$code]['messages'];
}
+ /**
+ * Get a message for a given language
+ */
+ static function getMessageFor( $key, $code ) {
+ self::loadLocalisation( $code );
+ return @self::$mLocalisationCache[$code]['messages'][$key];
+ }
+
/**
* Load localisation data for this object
*/
}
}
-/** @deprecated */
-class LanguageUtf8 extends Language {}
?>