Beispiel #1
0
 function getMessage($key)
 {
     global $wgAllMessagesZh_tw;
     if (array_key_exists($key, $wgAllMessagesZh_tw)) {
         return $wgAllMessagesZh_tw[$key];
     } else {
         return parent::getMessage($key);
     }
 }
Beispiel #2
0
 function stripForSearch($string)
 {
     $fname = "LanguageZh::stripForSearch";
     wfProfileIn($fname);
     // eventually this should be a word segmentation
     // for now just treat each character as a word
     $t = preg_replace("/([\\xc0-\\xff][\\x80-\\xbf]*)/e", "' ' .\"\$1\"", $string);
     //always convert to zh-cn before indexing. it should be
     //better to use zh-cn for search, since conversion from
     //Traditional to Simplified is less ambiguous than the
     //other way around
     $t = $this->mConverter->autoConvert($t, 'zh-cn');
     $t = parent::stripForSearch($t);
     wfProfileOut($fname);
     return $t;
 }