}
function getPageRenderingHash() {
- global $wgContLang;
+ global $wgContLang;
if( $this->mHash ){
return $this->mHash;
}
$confstr .= '!' . $this->getOption( 'date' );
$confstr .= '!' . $this->getOption( 'numberheadings' );
$confstr .= '!' . $this->getOption( 'language' );
- // add in language variant option if there are multiple variants
- // supported by the language object
- if(sizeof($wgContLang->getVariants())>1) {
- $confstr .= '!' . $this->getOption( 'variant' );
+ // add in language specific options, if any
+ $extra = $wgContLang->getExtraHashOptions();
+ foreach( $extra as $e ) {
+ $confstr .= '!' . $this->getOption( $e );
}
$this->mHash = $confstr;
}
}
}
+
+ /*
+ returns an array of extra options used by User::getPageRenderHash()
+ */
+ function getExtraHashOptions() {
+ return array();
+ }
+
}
# This should fail gracefully if there's not a localization available
function convertForSearchResult( $termsArray ) {
return $termsArray;
}
+
+ function getExtraHashOptions() {
+ return array();
+ }
+
}
?>
var $mZhClient=false;
function LanguageZh() {
global $wgUseZhdaemon, $wgZhdaemonHost, $wgZhdaemonPort;
- global $wgDisableLangConversion;
+ global $wgDisableLangConversion, $wgUser;
+
+ if( $wgUser->getID()!=0 ) {
+ /* allow user to diable conversion */
+ if( $wgDisableLangConversion == false &&
+ $wgUser->getOption('nolangconversion') == 1)
+ $wgDisableLangConversion = true;
+ }
$this->mZhLanguageCode = $this->getPreferredVariant();
if($wgUseZhdaemon) {
$ret = array_unique( explode('|', $terms) );
return $ret;
}
+
+ function getExtraHashOptions() {
+ return array('variant', 'nolangconversion');
+ }
}
?>
"Amazon.com" => "http://www.amazon.com/exec/obidos/ISBN=$1"
);
+/* private */ $wgUserTogglesZh_cn = array(
+ 'nolangconversion',
+) + $wgUserTogglesEn;
+
# All special pages have to be listed here: a description of ""
# will make them not show up on the "Special Pages" page, which
"tog-watchdefault" => "监视新的以及更改过的文章", /* "Watch new and modified articles", */
"tog-minordefault" => "细微编辑为默认设置", /* "Mark all edits minor by default", */
"tog-previewontop" => "在编辑框上方显示预览", /* "Show preview before edit box and not after it" */
-
+"tog-nolangconversion" => "不进行繁简体转换", /* "disable language conversion" */
# Dates
'sunday' => "星期日",
return $wgBookstoreListZh_cn ;
}
+ function getUserToggles() {
+ global $wgUserTogglesZh_cn;
+ return $wgUserTogglesZh_cn;
+ }
+
function getNamespaces() {
global $wgNamespaceNamesZh_cn;
return $wgNamespaceNamesZh_cn;