From: Brion Vibber Date: Sat, 1 Jul 2006 19:05:46 +0000 (+0000) Subject: Revert breakage from 15190. Broke 'Wikipedia' meta namespace X-Git-Tag: 1.31.0-rc.0~56486 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=bdb22267e60b9d2a71617624904012e4eb69c9a6;p=lhc%2Fweb%2Fwiklou.git Revert breakage from 15190. Broke 'Wikipedia' meta namespace --- diff --git a/languages/LanguageZh_cn.php b/languages/LanguageZh_cn.php index a984dcc883..df008d7bb9 100644 --- a/languages/LanguageZh_cn.php +++ b/languages/LanguageZh_cn.php @@ -1,76 +1,100 @@ '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()