Index: branches/REL1_4/phase3/includes/User.php |
— | — | @@ -970,7 +970,7 @@ |
971 | 971 | } |
972 | 972 | |
973 | 973 | function getPageRenderingHash() { |
974 | | - global $wgContLang; |
| 974 | + global $wgContLang; |
975 | 975 | if( $this->mHash ){ |
976 | 976 | return $this->mHash; |
977 | 977 | } |
— | — | @@ -987,10 +987,10 @@ |
988 | 988 | $confstr .= '!' . $this->getOption( 'date' ); |
989 | 989 | $confstr .= '!' . $this->getOption( 'numberheadings' ); |
990 | 990 | $confstr .= '!' . $this->getOption( 'language' ); |
991 | | - // add in language variant option if there are multiple variants |
992 | | - // supported by the language object |
993 | | - if(sizeof($wgContLang->getVariants())>1) { |
994 | | - $confstr .= '!' . $this->getOption( 'variant' ); |
| 991 | + // add in language specific options, if any |
| 992 | + $extra = $wgContLang->getExtraHashOptions(); |
| 993 | + foreach( $extra as $e ) { |
| 994 | + $confstr .= '!' . $this->getOption( $e ); |
995 | 995 | } |
996 | 996 | |
997 | 997 | $this->mHash = $confstr; |
Index: branches/REL1_4/phase3/languages/LanguageLatin1.php |
— | — | @@ -292,6 +292,10 @@ |
293 | 293 | function convertForSearchResult( $termsArray ) { |
294 | 294 | return $termsArray; |
295 | 295 | } |
| 296 | + |
| 297 | + function getExtraHashOptions() { |
| 298 | + return array(); |
| 299 | + } |
296 | 300 | } |
297 | 301 | |
298 | 302 | ?> |
Index: branches/REL1_4/phase3/languages/Language.php |
— | — | @@ -2222,6 +2222,13 @@ |
2223 | 2223 | } |
2224 | 2224 | } |
2225 | 2225 | } |
| 2226 | + |
| 2227 | + /* |
| 2228 | + returns an array of extra options used by User::getPageRenderHash() |
| 2229 | + */ |
| 2230 | + function getExtraHashOptions() { |
| 2231 | + return array(); |
| 2232 | + } |
2226 | 2233 | } |
2227 | 2234 | |
2228 | 2235 | # This should fail gracefully if there's not a localization available |
Index: branches/REL1_4/phase3/languages/LanguageZh.php |
— | — | @@ -15,7 +15,14 @@ |
16 | 16 | var $mZhClient=false; |
17 | 17 | function LanguageZh() { |
18 | 18 | global $wgUseZhdaemon, $wgZhdaemonHost, $wgZhdaemonPort; |
19 | | - global $wgDisableLangConversion; |
| 19 | + global $wgDisableLangConversion, $wgUser; |
| 20 | + |
| 21 | + if( $wgUser->getID()!=0 ) { |
| 22 | + /* allow user to diable conversion */ |
| 23 | + if( $wgDisableLangConversion == false && |
| 24 | + $wgUser->getOption('nolangconversion') == 1) |
| 25 | + $wgDisableLangConversion = true; |
| 26 | + } |
20 | 27 | |
21 | 28 | $this->mZhLanguageCode = $this->getPreferredVariant(); |
22 | 29 | if($wgUseZhdaemon) { |
— | — | @@ -137,5 +144,9 @@ |
138 | 145 | $ret = array_unique( explode('|', $terms) ); |
139 | 146 | return $ret; |
140 | 147 | } |
| 148 | + |
| 149 | + function getExtraHashOptions() { |
| 150 | + return array('variant', 'nolangconversion'); |
| 151 | + } |
141 | 152 | } |
142 | 153 | ?> |
Index: branches/REL1_4/phase3/languages/LanguageZh_cn.php |
— | — | @@ -58,6 +58,9 @@ |
59 | 59 | "Amazon.com" => "http://www.amazon.com/exec/obidos/ISBN=$1" |
60 | 60 | ); |
61 | 61 | |
| 62 | +/* private */ $wgUserTogglesZh_cn = array( |
| 63 | + 'nolangconversion', |
| 64 | +) + $wgUserTogglesEn; |
62 | 65 | |
63 | 66 | # All special pages have to be listed here: a description of "" |
64 | 67 | # will make them not show up on the "Special Pages" page, which |
— | — | @@ -147,7 +150,7 @@ |
148 | 151 | "tog-watchdefault" => "监视新的以及更改过的文章", /* "Watch new and modified articles", */ |
149 | 152 | "tog-minordefault" => "细微编辑为默认设置", /* "Mark all edits minor by default", */ |
150 | 153 | "tog-previewontop" => "在编辑框上方显示预览", /* "Show preview before edit box and not after it" */ |
151 | | - |
| 154 | +"tog-nolangconversion" => "不进行繁简体转换", /* "disable language conversion" */ |
152 | 155 | # Dates |
153 | 156 | |
154 | 157 | 'sunday' => "星期日", |
— | — | @@ -958,6 +961,11 @@ |
959 | 962 | return $wgBookstoreListZh_cn ; |
960 | 963 | } |
961 | 964 | |
| 965 | + function getUserToggles() { |
| 966 | + global $wgUserTogglesZh_cn; |
| 967 | + return $wgUserTogglesZh_cn; |
| 968 | + } |
| 969 | + |
962 | 970 | function getNamespaces() { |
963 | 971 | global $wgNamespaceNamesZh_cn; |
964 | 972 | return $wgNamespaceNamesZh_cn; |