Index: trunk/phase3/includes/ZhConversion.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | phrases are limited to below 5 characters. |
19 | 19 | */ |
20 | 20 | |
21 | | -$wgZhSimp2Trad=array( |
| 21 | +$zhSimp2Trad=array( |
22 | 22 | "万"=>"萬", |
23 | 23 | "与"=>"與", |
24 | 24 | "丑"=>"醜", |
— | — | @@ -5028,6 +5028,7 @@ |
5029 | 5029 | "庞克" => "龐克", |
5030 | 5030 | "龟壳" => "龜殼", |
5031 | 5031 | "当" => "當", |
| 5032 | + |
5032 | 5033 | "一国两制" => "一國兩制", |
5033 | 5034 | "一拍即合" => "一拍即合", |
5034 | 5035 | "一板一眼" => "一板一眼", |
— | — | @@ -5465,7 +5466,7 @@ |
5466 | 5467 | "麦当奴道" => "麥當奴道", |
5467 | 5468 | ); |
5468 | 5469 | |
5469 | | -$wgZhTrad2Simp=array( |
| 5470 | +$zhTrad2Simp=array( |
5470 | 5471 | "么"=>"么", |
5471 | 5472 | "瀋"=>"沈", |
5472 | 5473 | "畫"=>"划", |
— | — | @@ -8328,6 +8329,7 @@ |
8329 | 8330 | "鍛鍾" => "锻锺", |
8330 | 8331 | "雕畫" => "雕画", |
8331 | 8332 | "鯰魚" => "鲶鱼", |
| 8333 | + |
8332 | 8334 | "三聯畫" => "三联画", |
8333 | 8335 | "人物畫" => "人物画", |
8334 | 8336 | "餘光中" => "余光中", |
— | — | @@ -8380,6 +8382,7 @@ |
8381 | 8383 | "靜物畫" => "静物画", |
8382 | 8384 | "風景畫" => "风景画", |
8383 | 8385 | "麻黃鹼" => "麻黄碱", |
| 8386 | + |
8384 | 8387 | "一筆一畫" => "一笔一画", |
8385 | 8388 | "亂塗亂畫" => "乱涂乱画", |
8386 | 8389 | "餘事後敘" => "余事后叙", |
Index: trunk/phase3/languages/LanguageZh.php |
— | — | @@ -2,8 +2,16 @@ |
3 | 3 | require_once( "LanguageUtf8.php" ); |
4 | 4 | require_once( "LanguageZh_cn.php"); |
5 | 5 | require_once( "LanguageZh_tw.php"); |
6 | | -require_once( "ZhConversion.php"); |
7 | 6 | |
| 7 | +/* caching the conversion tables */ |
| 8 | +$zhSimp2Trad = $wgMemc->get($key1 = "$wgDBname:zhConvert:s2t"); |
| 9 | +$zhTrad2Simp = $wgMemc->get($key2 = "$wgDBname:zhConvert:t2s"); |
| 10 | +if(empty($zhSimp2Trad) || empty($zhTrad2Simp)) { |
| 11 | + require_once("includes/ZhConversion.php"); |
| 12 | + $wgMemc->set($key1, $zhSimp2Trad); |
| 13 | + $wgMemc->set($key2, $zhTrad2Simp); |
| 14 | +} |
| 15 | + |
8 | 16 | /* class that handles both Traditional and Simplified Chinese |
9 | 17 | right now it only distinguish zh_cn and zh_tw (actuall, zh_cn and |
10 | 18 | non-zh_cn), will add support for zh_sg, zh_hk, etc, later. |
— | — | @@ -53,13 +61,13 @@ |
54 | 62 | /* the Simplified/Traditional conversion stuff */ |
55 | 63 | |
56 | 64 | function simp2trad($text) { |
57 | | - global $wgZhSimp2Trad; |
58 | | - return strtr($text, $wgZhSimp2Trad); |
| 65 | + global $zhSimp2Trad; |
| 66 | + return strtr($text, $zhSimp2Trad); |
59 | 67 | } |
60 | 68 | |
61 | 69 | function trad2simp($text) { |
62 | | - global $wgZhTrad2Simp; |
63 | | - return strtr($text, $wgZhTrad2Simp); |
| 70 | + global $zhTrad2Simp; |
| 71 | + return strtr($text, $zhTrad2Simp); |
64 | 72 | } |
65 | 73 | |
66 | 74 | function autoConvert($text) { |