* Update to Catalan translation (ca)
[mediawiki.git] / languages / LanguageKo.php
blobd1a64b93e16786f66004a701c23ea1456c415b25
1 <?php
2 /** Korean (한국어)
4 * @package MediaWiki
5 * @subpackage Language
6 */
8 require_once('LanguageUtf8.php');
10 if (!$wgCachedMessageArrays) {
11 require_once('MessagesKo.php');
14 class LanguageKo extends LanguageUtf8 {
15 private $mMessagesKo, $mNamespaceNamesKo = null;
17 private $mQuickbarSettingsKo = array(
18 '없음', '왼쪽', '오른쪽', '왼쪽 고정', '오른쪽 고정'
21 private $mSkinNamesKo = array(
22 'standard' => '기본값',
23 'davinci' => '다빈치',
24 'mono' => '모노',
25 'monobook' => '모노북',
26 'my skin' => '내 스킨',
29 private $mBookstoreListKo = array(
30 'Aladdin.co.kr' => 'http://www.aladdin.co.kr/catalog/book.asp?ISBN=$1'
33 # (Okay, I think I got it right now. This can be adjusted
34 # in the 'date' function down at the bottom. --Brion)
36 # Thanks. And it's usual that the time comes after dates.
37 # So I've change the timeanddate function, just exchanged $time and $date
38 # But you should check before you install it, 'cause I'm quite stupid about
39 # the programming.
42 private $mWeekdayAbbreviationsKo = array(
43 '일', '월', '화', '수', '목', '금', '토'
46 function __construct() {
47 parent::__construct();
49 global $wgAllMessagesKo;
50 $this->mMessagesKo =& $wgAllMessagesKo;
52 global $wgMetaNamespace;
53 $this->mNamespaceNamesKo = array(
54 NS_MEDIA => 'Media',
55 NS_SPECIAL => '특수기능',
56 NS_MAIN => '',
57 NS_TALK => '토론',
58 NS_USER => '사용자',
59 NS_USER_TALK => '사용자토론',
60 NS_PROJECT => $wgMetaNamespace,
61 NS_PROJECT_TALK => $wgMetaNamespace.'토론',
62 NS_IMAGE => '그림',
63 NS_IMAGE_TALK => '그림토론',
64 NS_HELP => '도움말',
65 NS_HELP_TALK => '도움말토론',
66 NS_CATEGORY => '분류',
67 NS_CATEGORY_TALK => '분류토론',
72 function getNamespaces() {
73 return $this->mNamespaceNamesKo + parent::getNamespaces();
76 function getQuickbarSettings() {
77 return $this->mQuickbarSettingsKo;
80 function getSkinNames() {
81 return $this->mSkinNamesKo + parent::getSkinNames();
84 function getBookstoreList() {
85 return $this->mBookstoreListKo + parent::getBookstoreList();
88 function getDateFormats() {
89 return false;
92 function getMessage( $key ) {
93 if( isset( $this->mMessagesKo[$key] ) ) {
94 return $this->mMessagesKo[$key];
95 } else {
96 return parent::getMessage( $key );
100 function getAllMessages() {
101 return $this->mMessagesKo;
104 function date( $ts, $adj = false ) {
105 if ( $adj ) { $ts = $this->userAdjust( $ts ); }
107 $year = (int)substr( $ts, 0, 4 );
108 $month = (int)substr( $ts, 4, 2 );
109 $mday = (int)substr( $ts, 6, 2 );
110 $hour = (int)substr( $ts, 8, 2 );
111 $minute = (int)substr( $ts, 10, 2 );
112 $second = (int)substr( $ts, 12, 2 );
113 $time = mktime( $hour, $minute, $second, $month, $mday, $year );
114 $date = getdate( $time );
116 # "xxxx년 xx월 xx일 (월)"
117 # timeanddate works "xxxx년 xx월 xx일 (월) xx:xx"
118 $d = $year . "년 " .
119 $this->getMonthAbbreviation( $month ) . "월 " .
120 $mday . "일 ".
121 "(" . $this->mWeekdayAbbreviationsKo[ $date['wday'] ]. ")";
123 return $d;
126 function timeBeforeDate() {
127 return false;
130 function timeDateSeparator( $format ) {
131 return ' ';
134 function firstChar( $s ) {
135 preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
136 '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})/', $s, $matches);
138 if ( isset( $matches[1] ) ) {
139 if ( strlen( $matches[1] ) != 3 ) {
140 return $matches[1];
142 $code = (ord($matches[1]{0}) & 0x0f) << 12;
143 $code |= (ord($matches[1]{1}) & 0x3f) << 6;
144 $code |= (ord($matches[1]{2}) & 0x3f);
145 if ( $code < 0xac00 || 0xd7a4 <= $code) {
146 return $matches[1];
147 } elseif ( $code < 0xb098 ) {
148 return "\xe3\x84\xb1";
149 } elseif ( $code < 0xb2e4 ) {
150 return "\xe3\x84\xb4";
151 } elseif ( $code < 0xb77c ) {
152 return "\xe3\x84\xb7";
153 } elseif ( $code < 0xb9c8 ) {
154 return "\xe3\x84\xb9";
155 } elseif ( $code < 0xbc14 ) {
156 return "\xe3\x85\x81";
157 } elseif ( $code < 0xc0ac ) {
158 return "\xe3\x85\x82";
159 } elseif ( $code < 0xc544 ) {
160 return "\xe3\x85\x85";
161 } elseif ( $code < 0xc790 ) {
162 return "\xe3\x85\x87";
163 } elseif ( $code < 0xcc28 ) {
164 return "\xe3\x85\x88";
165 } elseif ( $code < 0xce74 ) {
166 return "\xe3\x85\x8a";
167 } elseif ( $code < 0xd0c0 ) {
168 return "\xe3\x85\x8b";
169 } elseif ( $code < 0xd30c ) {
170 return "\xe3\x85\x8c";
171 } elseif ( $code < 0xd558 ) {
172 return "\xe3\x85\x8d";
173 } else {
174 return "\xe3\x85\x8e";
176 } else {
177 return "";