Check that accounts have no uploads prior to calling them unused
[lhc/web/wiklou.git] / languages / LanguageZh_cn.php
1 <?php
2 /**
3 * @package MediaWiki
4 * @subpackage Language
5 */
6 require_once( 'LanguageUtf8.php' );
7
8 /* private */ $wgNamespaceNamesZh_cn = array(
9 NS_MEDIA => 'Media',
10 NS_SPECIAL => 'Special',
11 NS_MAIN => '',
12 NS_TALK => 'Talk',
13 NS_USER => 'User',
14 NS_USER_TALK => 'User_talk',
15 NS_PROJECT => $wgMetaNamespace,
16 NS_PROJECT_TALK => $wgMetaNamespace . '_talk',
17 NS_IMAGE => 'Image',
18 NS_IMAGE_TALK => 'Image_talk',
19 NS_MEDIAWIKI => 'MediaWiki',
20 NS_MEDIAWIKI_TALK => 'MediaWiki_talk',
21 NS_TEMPLATE => 'Template',
22 NS_TEMPLATE_TALK => 'Template_talk',
23 NS_HELP => 'Help',
24 NS_HELP_TALK => 'Help_talk',
25 NS_CATEGORY => 'Category',
26 NS_CATEGORY_TALK => 'Category_talk'
27
28 ) + $wgNamespaceNamesEn;
29
30 /* private */ $wgQuickbarSettingsZh_cn = array(
31 "无", /* "None" */
32 "左侧固定", /* "Fixed left" */
33 "右侧固定", /* "Fixed right" */
34 "左侧漂移" /* "Floating left" */
35 );
36
37 /* private */ $wgSkinNamesZh_cn = array(
38 'standard' => "标准",
39 'nostalgia' => "怀旧",
40 'cologneblue' => "科隆香水蓝"
41 ) + $wgSkinNamesEn;
42
43 /* private */ $wgUserTogglesZh_cn = array(
44 'nolangconversion',
45 ) + $wgUserTogglesEn;
46
47
48 if (!$wgCachedMessageArrays) {
49 require_once('MessagesZh_cn.php');
50 }
51
52
53 class LanguageZh_cn extends LanguageUtf8 {
54
55 function getUserToggles() {
56 global $wgUserTogglesZh_cn;
57 return $wgUserTogglesZh_cn;
58 }
59
60 function getNamespaces() {
61 global $wgNamespaceNamesZh_cn;
62 return $wgNamespaceNamesZh_cn;
63 }
64
65
66 function getNsIndex( $text ) {
67 global $wgNamespaceNamesZh_cn;
68
69 foreach ( $wgNamespaceNamesZh_cn as $i => $n ) {
70 if ( 0 == strcasecmp( $n, $text ) ) { return $i; }
71 }
72 # Aliases
73 if ( 0 == strcasecmp( "特殊", $text ) ) { return -1; }
74 if ( 0 == strcasecmp( "", $text ) ) { return ; }
75 if ( 0 == strcasecmp( "对话", $text ) ) { return 1; }
76 if ( 0 == strcasecmp( "用户", $text ) ) { return 2; }
77 if ( 0 == strcasecmp( "用户对话", $text ) ) { return 3; }
78 if ( 0 == strcasecmp( "{{SITENAME}}_对话", $text ) ) { return 5; }
79 if ( 0 == strcasecmp( "图像", $text ) ) { return 6; }
80 if ( 0 == strcasecmp( "图像对话", $text ) ) { return 7; }
81 return false;
82 }
83
84 function getQuickbarSettings() {
85 global $wgQuickbarSettingsZh_cn;
86 return $wgQuickbarSettingsZh_cn;
87 }
88
89 function getSkinNames() {
90 global $wgSkinNamesZh_cn;
91 return $wgSkinNamesZh_cn;
92 }
93
94 function getDateFormats() {
95 return false;
96 }
97
98 function date( $ts, $adj = false ) {
99 if ( $adj ) { $ts = $this->userAdjust( $ts ); }
100
101 $d = substr( $ts, 0, 4 ) . "年" .
102 $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) .
103 (0 + substr( $ts, 6, 2 )) . "日";
104 return $d;
105 }
106
107 function timeanddate( $ts, $adj = false ) {
108 return $this->time( $ts, $adj ) . " " . $this->date( $ts, $adj );
109 }
110
111 function getMessage( $key ) {
112 global $wgAllMessagesZh_cn;
113 if( isset( $wgAllMessagesZh_cn[$key] ) )
114 return $wgAllMessagesZh_cn[$key];
115 else
116 return parent::getMessage( $key );
117 }
118
119 # inherit default iconv(), ucfirst(), checkTitleEncoding()
120
121 function stripForSearch( $string ) {
122 # MySQL fulltext index doesn't grok utf-8, so we
123 # need to fold cases and convert to hex
124 # we also separate characters as "words"
125 if( function_exists( 'mb_strtolower' ) ) {
126 return preg_replace(
127 "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
128 "' U8' . bin2hex( \"$1\" )",
129 mb_strtolower( $string ) );
130 } else {
131 global $wikiLowerChars;
132 return preg_replace(
133 "/([\\xc0-\\xff][\\x80-\\xbf]*)/e",
134 "' U8' . bin2hex( strtr( \"\$1\", \$wikiLowerChars ) )",
135 $string );
136 }
137 }
138 }
139
140
141 ?>