<?php
/**
- * Japan (日本語)
+ * Japanese (日本語)
*
* @package MediaWiki
* @subpackage Language
*/
-
-require_once( "LanguageUtf8.php" );
-
-if (!$wgCachedMessageArrays) {
- require_once('MessagesJa.php');
-}
-
-class LanguageJa extends LanguageUtf8 {
- private $mMessagesJa, $mNamespaceNamesJa = null;
-
- private $mQuickbarSettingsJa = array(
- "なし", "左端", "右端", "ウィンドウの左上に固定"
- );
-
- private $mSkinNamesJa = array(
- 'standard' => "標準",
- 'nostalgia' => "ノスタルジア",
- 'cologneblue' => "ケルンブルー",
- );
-
- private $mDateFormatsJa = array(
- MW_DATE_DEFAULT => '2001年1月15日 16:12 (デフォルト)',
- MW_DATE_ISO => '2001-01-15 16:12:34'
- );
-
- private $mWeekdayAbbreviationsJa = array(
- "日", "月", "火", "水", "木", "金", "土"
- );
-
- function __construct() {
- parent::__construct();
-
- global $wgAllMessagesJa;
- $this->mMessagesJa =& $wgAllMessagesJa;
-
- global $wgMetaNamespace;
- $this->mNamespaceNamesJa = array(
- NS_MEDIA => "Media", /* Media */
- NS_SPECIAL => "特別", /* Special */
- NS_MAIN => "",
- NS_TALK => "ノート", /* Talk */
- NS_USER => "利用者", /* User */
- NS_USER_TALK => "利用者‐会話", /* User_talk */
- NS_PROJECT => $wgMetaNamespace, /* Wikipedia */
- NS_PROJECT_TALK => "{$wgMetaNamespace}‐ノート", /* Wikipedia_talk */
- NS_IMAGE => "画像", /* Image */
- NS_IMAGE_TALK => "画像‐ノート", /* Image_talk */
- NS_MEDIAWIKI => "MediaWiki", /* MediaWiki */
- NS_MEDIAWIKI_TALK => "MediaWiki‐ノート", /* MediaWiki_talk */
- NS_TEMPLATE => "Template", /* Template */
- NS_TEMPLATE_TALK => "Template‐ノート", /* Template_talk */
- NS_HELP => "Help", /* Help */
- NS_HELP_TALK => "Help‐ノート", /* Help_talk */
- NS_CATEGORY => "Category", /* Category */
- NS_CATEGORY_TALK => "Category‐ノート" /* Category_talk */
-
- );
- }
-
- function getNamespaces() {
- return $this->mNamespaceNamesJa + parent::getNamespaces();
- }
-
- function getQuickbarSettings() {
- return $this->mQuickbarSettingsJa;
- }
-
- function getSkinNames() {
- return $this->mSkinNamesJa + parent::getSkinNames();
- }
-
- function getDateFormats() {
- return $this->mDateFormatsJa;
- }
-
- function getMessage( $key ) {
- if( isset( $this->mMessagesJa[$key] ) ) {
- return $this->mMessagesJa[$key];
- } else {
- return parent::getMessage( $key );
- }
- }
-
- function getAllMessages() {
- return $this->mMessagesJa;
- }
-
- function date( $ts, $adj = false, $format = true, $tc = false ) {
-
- if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); }
- $datePreference = $this->dateFormat( $format );
-
- if( $datePreference == MW_DATE_ISO ) {
- $d = substr($ts, 0, 4). '-' . substr($ts, 4, 2). '-' .
- substr($ts, 6, 2);
- return $d;
- }
-
- $year = (int)substr( $ts, 0, 4 );
- $month = (int)substr( $ts, 4, 2 );
- $mday = (int)substr( $ts, 6, 2 );
- $hour = (int)substr( $ts, 8, 2 );
- $minute = (int)substr( $ts, 10, 2 );
- $second = (int)substr( $ts, 12, 2 );
-
- $time = mktime( $hour, $minute, $second, $month, $mday, $year );
- $date = getdate( $time );
-
- $d = $year . "年" .
- $this->getMonthAbbreviation( $month ) .
- $mday . "日 (" .
- $this->mWeekdayAbbreviationsJa[ $date['wday'] ]. ")";
- return $d;
- }
-
- function time( $ts, $adj = false, $format = true, $tc = false ) {
- if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); }
- $datePreference = $this->dateFormat( $format );
-
- $t = substr( $ts, 8, 2 ) . ":" . substr( $ts, 10, 2 );
- if ( $datePreference == MW_DATE_ISO ) {
- $t .= ':' . substr( $ts, 12, 2 );
- }
-
- return $t;
- }
-
- function timeanddate( $ts, $adj = false, $format = true, $tc = false ) {
- return $this->date( $ts, $adj, $format, $tc ) . " " . $this->time( $ts, $adj, $format, $tc );
- }
-
+class LanguageJa extends Language {
function stripForSearch( $string ) {
# MySQL fulltext index doesn't grok utf-8, so we
# need to fold cases and convert to hex