formatting fix (space->tab)
authorZheng Zhu <zhengzhu@users.mediawiki.org>
Mon, 4 Oct 2004 04:14:05 +0000 (04:14 +0000)
committerZheng Zhu <zhengzhu@users.mediawiki.org>
Mon, 4 Oct 2004 04:14:05 +0000 (04:14 +0000)
languages/LanguageZh.php

index c98255c..b450a7a 100644 (file)
@@ -6,9 +6,9 @@ require_once( "LanguageZh_tw.php");
 $zhSimp2Trad = $wgMemc->get($key1 = "$wgDBname:zhConvert:s2t");
 $zhTrad2Simp = $wgMemc->get($key2 = "$wgDBname:zhConvert:t2s");
 if(empty($zhSimp2Trad) || empty($zhTrad2Simp)) {
-    require_once("includes/ZhConversion.php");
-    $wgMemc->set($key1, $zhSimp2Trad);
-    $wgMemc->set($key2, $zhTrad2Simp);
+       require_once("includes/ZhConversion.php");
+       $wgMemc->set($key1, $zhSimp2Trad);
+       $wgMemc->set($key2, $zhTrad2Simp);
 }
 
 /* class that handles both Traditional and Simplified Chinese
@@ -16,41 +16,41 @@ if(empty($zhSimp2Trad) || empty($zhTrad2Simp)) {
    non-zh_cn), will add support for zh_sg, zh_hk, etc, later.
 */
 class LanguageZh extends LanguageZh_cn {
-    
-    var $mZhLanguageCode=false;
-
-    function LanguageZh() {
-        $this->mZhLanguageCode = $this->getPreferredVariant();
-    }
-
-    /* 
-       get preferred language variants. eventually this will check the
-       user's preference setting as well, once the language option in
-       the setting pages is finalized.
-    */
-    function getPreferredVariant() {
-        global $wgUser;
-
-        if($this->mZhLanguageCode)
-            return $this->mZhLanguageCode;
-
-        // get language variant preference for logged in users 
-        if($wgUser->getID()!=0) {
-            $this->mZhLanguageCode = $wgUser->getOption('variant');
-        }
-        else {
-            // see if some zh- variant is set in the http header,
-            $this->mZhLanguageCode="zh-cn";
-            $header = str_replace( '_', '-', strtolower($_SERVER["HTTP_ACCEPT_LANGUAGE"]));
-            $zh = strstr($header, 'zh-');
-            if($zh) {
-                $this->mZhLanguageCode = substr($zh,0,5);
-            }
-        }
-        return $this->mZhLanguageCode;
-    }
-    
-    
+       
+       var $mZhLanguageCode=false;
+       
+       function LanguageZh() {
+               $this->mZhLanguageCode = $this->getPreferredVariant();
+       }
+       
+       /* 
+               get preferred language variants. eventually this will check the
+               user's preference setting as well, once the language option in
+               the setting pages is finalized.
+       */
+       function getPreferredVariant() {
+               global $wgUser;
+               
+               if($this->mZhLanguageCode)
+                       return $this->mZhLanguageCode;
+               
+               // get language variant preference for logged in users 
+               if($wgUser->getID()!=0) {
+                       $this->mZhLanguageCode = $wgUser->getOption('variant');
+               }
+               else {
+                       // see if some zh- variant is set in the http header,
+                       $this->mZhLanguageCode="zh-cn";
+                       $header = str_replace( '_', '-', strtolower($_SERVER["HTTP_ACCEPT_LANGUAGE"]));
+                       $zh = strstr($header, 'zh-');
+                       if($zh) {
+                               $this->mZhLanguageCode = substr($zh,0,5);
+                       }
+               }
+               return $this->mZhLanguageCode;
+       }
+       
+       
   /* the Simplified/Traditional conversion stuff */
 
        function simp2trad($text) {
@@ -75,8 +75,8 @@ class LanguageZh extends LanguageZh_cn {
                }
        }
 
-    function getVariants() {
-        return array("zh-cn", "zh-tw");
-    }
+       function getVariants() {
+               return array("zh-cn", "zh-tw");
+       }
 }
 ?>