2 /** Simplified Chinese (中文(简体))
8 require_once( 'LanguageUtf8.php' );
10 if (!$wgCachedMessageArrays) {
11 require_once('MessagesZh_cn.php');
14 class LanguageZh_cn
extends LanguageUtf8
{
15 private $mMessagesZh_cn, $mNamespaceNamesZh_cn = null;
17 private $mQuickbarSettingsZh_cn = array(
19 '左侧固定', /* 'Fixed left' */
20 '右侧固定', /* 'Fixed right' */
21 '左侧漂移' /* 'Floating left' */
24 private $mSkinNamesZh_cn = array(
27 'cologneblue' => '科隆香水蓝'
31 function __construct() {
32 parent
::__construct();
34 global $wgAllMessagesZh_cn;
35 $this->mMessagesZh_cn
=& $wgAllMessagesZh_cn;
39 function getQuickbarSettings() {
40 return $this->mQuickbarSettingsZh_cn
;
43 function getSkinNames() {
44 return $this->mSkinNamesZh_cn + parent
::getSkinNames();
47 function getDateFormats() {
51 function getMessage( $key ) {
52 if( isset( $this->mMessagesZh_cn
[$key] ) ) {
53 return $this->mMessagesZh_cn
[$key];
55 return parent
::getMessage( $key );
59 function getAllMessages() {
60 return $this->mMessagesZh_cn
;
63 function getNsIndex( $text ) {
65 if ( 0 == strcasecmp( "特殊", $text ) ) { return -1; }
66 if ( 0 == strcasecmp( "对话", $text ) ) { return 1; }
67 if ( 0 == strcasecmp( "用户", $text ) ) { return 2; }
68 if ( 0 == strcasecmp( "用户对话", $text ) ) { return 3; }
69 if ( 0 == strcasecmp( "图像", $text ) ) { return 6; }
70 if ( 0 == strcasecmp( "图像对话", $text ) ) { return 7; }
74 function date( $ts, $adj = false ) {
75 if ( $adj ) { $ts = $this->userAdjust( $ts ); }
77 $d = substr( $ts, 0, 4 ) . "年" .
78 $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) .
79 (0 +
substr( $ts, 6, 2 )) . "日";
83 function timeDateSeparator( $format ) {
87 # inherit default iconv(), ucfirst(), checkTitleEncoding()
89 function stripForSearch( $string ) {
90 # MySQL fulltext index doesn't grok utf-8, so we
91 # need to fold cases and convert to hex
92 # we also separate characters as "words"
93 if( function_exists( 'mb_strtolower' ) ) {
95 "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
96 "' U8' . bin2hex( \"$1\" )",
97 mb_strtolower( $string ) );
99 global $wikiLowerChars;
101 "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
102 "' U8' . bin2hex( strtr( \"\$1\", \$wikiLowerChars ) )",