added convertForSearchResult() so that search results are correctly shown for languag...
authorZheng Zhu <zhengzhu@users.mediawiki.org>
Mon, 29 Nov 2004 01:22:44 +0000 (01:22 +0000)
committerZheng Zhu <zhengzhu@users.mediawiki.org>
Mon, 29 Nov 2004 01:22:44 +0000 (01:22 +0000)
languages/Language.php
languages/LanguageLatin1.php
languages/LanguageZh.php

index 57d6b2b..e7d38db 100644 (file)
@@ -1903,6 +1903,12 @@ class Language {
                return strtolower( $in );
        }
 
+       function convertForSearchResult( $termsArray ) {
+               # some languages, e.g. Chinese, need to do a conversion
+               # in order for search results to be displayed correctly
+               return $termsArray;
+       }       
+
        function firstChar( $s ) {
                # Get the first character of a string. In ASCII, return
                # first byte of the string. UTF8 and others have to
index c24f0be..e031007 100644 (file)
@@ -277,11 +277,13 @@ class LanguageLatin1 {
                return utf8_decode( $this->lang->convertTitle( utf8_encode( $text ) ) );
        }
 
-       
        function getVariants() {
                return $this->lang->getVariants();
        }
 
+       function convertForSearchResult( $termsArray ) {
+               return $termsArray;
+       }       
 }
 
 ?>
index 59afd08..644449a 100644 (file)
@@ -119,6 +119,12 @@ class LanguageZh extends LanguageZh_cn {
                return $t;
 
        }
-       
+
+       function convertForSearchResult( $termsArray ) {
+               $terms = implode( '|', $termsArray );
+               $terms = $this->autoConvert( $terms, 'zh-cn' );
+               $ret = array_unique( explode('|', $termsArray.'|'.$terms) );
+               return $ret;
+       }
 }
 ?>