Wikipedia:用戶介面翻譯/LanguageZh yue.php

出自維基百科,自由嘅百科全書

各用戶喺編輯呢啲原始碼時嘅注意事項:

  1. 位於 <pre> 同 </pre> 之外嘅文字會被忽略。
  2. 請以英文版嘅原始碼翻譯,以確保翻譯無誤。
  3. 建議對一小部份嘅原始碼作出修改,以確保原始碼嘅語法正確無誤。
  4. 擴展部件信息只會節錄英文同粵語部份,其它嘅語言將唔會列示。

<?php
/**
  * @package MediaWiki
  * @subpackage Language
  */
class LanguageZh_yue extends Language {
        function stripForSearch( $string ) {
                # MySQL fulltext index doesn't grok utf-8, so we
                # need to fold cases and convert to hex
                # we also separate characters as "words"
                if( function_exists( 'mb_strtolower' ) ) {
                        return preg_replace(
                                "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
                                "' U8' . bin2hex( \"$1\" )",
                                mb_strtolower( $string ) );
                } else {
                        list( , $wikiLowerChars ) = Language::getCaseMaps();
                        return preg_replace(
                                "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
                                "' U8' . bin2hex( strtr( \"\$1\", \$wikiLowerChars ) )",
                                $string );
                }
        }
}


?>