From: Niklas Laxström Date: Sat, 1 Jul 2006 13:02:29 +0000 (+0000) Subject: * Restructured X-Git-Tag: 1.31.0-rc.0~56497 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=3a4b0c78de1d39251c4e89586811f1c2b70b03d0;p=lhc%2Fweb%2Fwiklou.git * Restructured --- diff --git a/languages/LanguageZh_cn.php b/languages/LanguageZh_cn.php index df008d7bb9..a984dcc883 100644 --- a/languages/LanguageZh_cn.php +++ b/languages/LanguageZh_cn.php @@ -1,100 +1,76 @@ '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; +/** Simplified Chinese (中文(简体)) + * + * @package MediaWiki + * @subpackage Language + */ +require_once( 'LanguageUtf8.php' ); 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; - function getUserToggles() { - global $wgUserTogglesZh_cn; - return $wgUserTogglesZh_cn; } - function getNamespaces() { - global $wgNamespaceNamesZh_cn; - return $wgNamespaceNamesZh_cn; + function getQuickbarSettings() { + return $this->mQuickbarSettingsZh_cn; } + function getSkinNames() { + return $this->mSkinNamesZh_cn + parent::getSkinNames(); + } - function getNsIndex( $text ) { - global $wgNamespaceNamesZh_cn; + function getDateFormats() { + return false; + } - foreach ( $wgNamespaceNamesZh_cn as $i => $n ) { - if ( 0 == strcasecmp( $n, $text ) ) { return $i; } + function getMessage( $key ) { + if( isset( $this->mMessagesZh_cn[$key] ) ) { + return $this->mMessagesZh_cn[$key]; + } else { + return parent::getMessage( $key ); } + } + + 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 ); } @@ -104,16 +80,8 @@ class LanguageZh_cn extends LanguageUtf8 { return $d; } - 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 ); + function timeDateSeparator( $format ) { + return ' '; } # inherit default iconv(), ucfirst(), checkTitleEncoding()