Revert breakage from 15190. Broke 'Wikipedia' meta namespace
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 1 Jul 2006 19:05:46 +0000 (19:05 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 1 Jul 2006 19:05:46 +0000 (19:05 +0000)
languages/LanguageZh_cn.php

index a984dcc..df008d7 100644 (file)
 <?php
-/** Simplified Chinese (中文(简体))
- *
- * @package MediaWiki
- * @subpackage Language
- */
-
+/**
+  * @package MediaWiki
+  * @subpackage Language
+  */
 require_once( 'LanguageUtf8.php' );
 
+/* private */ $wgNamespaceNamesZh_cn = array(
+       NS_MEDIA            => 'Media',
+       NS_SPECIAL          => 'Special',
+       NS_MAIN             => '',
+       NS_TALK             => 'Talk',
+       NS_USER             => 'User',
+       NS_USER_TALK        => 'User_talk',
+       NS_PROJECT          => $wgMetaNamespace,
+       NS_PROJECT_TALK     => $wgMetaNamespace . '_talk',
+       NS_IMAGE            => 'Image',
+       NS_IMAGE_TALK       => 'Image_talk',
+       NS_MEDIAWIKI        => 'MediaWiki',
+       NS_MEDIAWIKI_TALK   => 'MediaWiki_talk',
+       NS_TEMPLATE         => 'Template',
+       NS_TEMPLATE_TALK    => 'Template_talk',
+       NS_HELP             => 'Help',
+       NS_HELP_TALK        => 'Help_talk',
+       NS_CATEGORY         => 'Category',
+       NS_CATEGORY_TALK    => 'Category_talk'
+
+) + $wgNamespaceNamesEn;
+
+/* private */ $wgQuickbarSettingsZh_cn = array(
+       "无", /* "None" */
+       "左侧固定", /* "Fixed left" */
+       "右侧固定", /* "Fixed right" */
+       "左侧漂移" /* "Floating left" */
+);
+
+/* private */ $wgSkinNamesZh_cn = array(
+       'standard' => "标准",
+       'nostalgia' => "怀旧",
+       'cologneblue' => "科隆香水蓝"
+) + $wgSkinNamesEn;
+
+/* private */ $wgUserTogglesZh_cn = array(
+       'nolangconversion',
+) + $wgUserTogglesEn;
+
+
 if (!$wgCachedMessageArrays) {
        require_once('MessagesZh_cn.php');
 }
 
-class LanguageZh_cn extends LanguageUtf8 {
-       private $mMessagesZh_cn, $mNamespaceNamesZh_cn = null;
-
-       private $mQuickbarSettingsZh_cn = array(
-               '无', /* 'None' */
-               '左侧固定', /* 'Fixed left' */
-               '右侧固定', /* 'Fixed right' */
-               '左侧漂移' /* 'Floating left' */
-       );
-       
-       private $mSkinNamesZh_cn = array(
-               'standard' => '标准',
-               'nostalgia' => '怀旧',
-               'cologneblue' => '科隆香水蓝'
-       );
-
-       
-       function __construct() {
-               parent::__construct();
 
-               global $wgAllMessagesZh_cn;
-               $this->mMessagesZh_cn =& $wgAllMessagesZh_cn;
+class LanguageZh_cn extends LanguageUtf8 {
 
+       function getUserToggles() {
+               global $wgUserTogglesZh_cn;
+               return $wgUserTogglesZh_cn;
        }
 
-       function getQuickbarSettings() {
-               return $this->mQuickbarSettingsZh_cn;
+       function getNamespaces() {
+               global $wgNamespaceNamesZh_cn;
+               return $wgNamespaceNamesZh_cn;
        }
 
-       function getSkinNames() {
-               return $this->mSkinNamesZh_cn + parent::getSkinNames();
-       }
 
-       function getDateFormats() {
-               return false;
-       }
+       function getNsIndex( $text ) {
+               global $wgNamespaceNamesZh_cn;
 
-       function getMessage( $key ) {
-               if( isset( $this->mMessagesZh_cn[$key] ) ) {
-                       return $this->mMessagesZh_cn[$key];
-               } else {
-                       return parent::getMessage( $key );
+               foreach ( $wgNamespaceNamesZh_cn as $i => $n ) {
+                       if ( 0 == strcasecmp( $n, $text ) ) { return $i; }
                }
-       }
-
-       function getAllMessages() {
-               return $this->mMessagesZh_cn;
-       }
-
-       function getNsIndex( $text ) {
                # Aliases
                if ( 0 == strcasecmp( "特殊", $text ) ) { return -1; }
+               if ( 0 == strcasecmp( "", $text ) ) { return ; }
                if ( 0 == strcasecmp( "对话", $text ) ) { return 1; }
                if ( 0 == strcasecmp( "用户", $text ) ) { return 2; }
                if ( 0 == strcasecmp( "用户对话", $text ) ) { return 3; }
+               if ( 0 == strcasecmp( "{{SITENAME}}_对话", $text ) ) { return 5; }
                if ( 0 == strcasecmp( "图像", $text ) ) { return 6; }
                if ( 0 == strcasecmp( "图像对话", $text ) ) { return 7; }
                return false;
        }
 
+       function getQuickbarSettings() {
+               global $wgQuickbarSettingsZh_cn;
+               return $wgQuickbarSettingsZh_cn;
+       }
+
+       function getSkinNames() {
+               global $wgSkinNamesZh_cn;
+               return $wgSkinNamesZh_cn;
+       }
+
+       function getDateFormats() {
+               return false;
+       }
+
        function date( $ts, $adj = false ) {
                if ( $adj ) { $ts = $this->userAdjust( $ts ); }
 
@@ -80,8 +104,16 @@ class LanguageZh_cn extends LanguageUtf8 {
                return $d;
        }
 
-       function timeDateSeparator( $format ) {
-               return ' ';
+       function timeanddate( $ts, $adj = false ) {
+               return $this->time( $ts, $adj ) . " " . $this->date( $ts, $adj );
+       }
+
+       function getMessage( $key ) {
+               global $wgAllMessagesZh_cn;
+               if( isset( $wgAllMessagesZh_cn[$key] ) )
+                       return $wgAllMessagesZh_cn[$key];
+               else
+                       return parent::getMessage( $key );
        }
 
        # inherit default iconv(), ucfirst(), checkTitleEncoding()