Live hack: Skip some work on empty category/link sets
[lhc/web/wiklou.git] / languages / LanguageKo.php
1 <?php
2 /** Korean (한국어)
3 *
4 * @package MediaWiki
5 * @subpackage Language
6 */
7 require_once('LanguageUtf8.php');
8
9 /* private */ $wgNamespaceNamesKo = array(
10 NS_MEDIA => 'Media',
11 NS_SPECIAL => '특수기능',
12 NS_MAIN => '',
13 NS_TALK => '토론',
14 NS_USER => '사용자',
15 NS_USER_TALK => '사용자토론',
16 NS_PROJECT => $wgMetaNamespace,
17 NS_PROJECT_TALK => $wgMetaNamespace.'토론',
18 NS_IMAGE => '그림',
19 NS_IMAGE_TALK => '그림토론',
20 NS_HELP => '도움말',
21 NS_HELP_TALK => '도움말토론',
22 NS_CATEGORY => '분류',
23 NS_CATEGORY_TALK => '분류토론',
24 ) + $wgNamespaceNamesEn;
25
26 /* private */ $wgQuickbarSettingsKo = array(
27 '없음', '왼쪽 붙박이', '오른쪽 붙박이', '왼쪽 떠다님'
28
29 );
30
31 /* private */ $wgSkinNamesKo = array(
32 'standard' => '보통',
33 'nostalgia' => '그리움',
34 'cologneblue' => '쾰른 파랑',
35 'davinci' => '다빈치',
36 'mono' => '모노',
37 'monobook' => '모노북(기본값)',
38 'my skin' => '내 스킨',
39 'chick' => '칙(Chick)',
40 ) + $wgSkinNamesEn;
41
42
43 /* private */ $wgBookstoreListKo = array(
44 'Aladdin.co.kr' => 'http://www.aladdin.co.kr/catalog/book.asp?ISBN=$1'
45 ) + $wgBookstoreListEn;
46
47
48
49 # (Okay, I think I got it right now. This can be adjusted
50 # in the 'date' function down at the bottom. --Brion)
51 #
52 # Thanks. And it's usual that the time comes after dates.
53 # So I've change the timeanddate function, just exchanged $time and $date
54 # But you should check before you install it, 'cause I'm quite stupid about
55 # the programming.
56 #
57
58 /* private */ $wgWeekdayAbbreviationsKo = array(
59 '일', '월', '화', '수', '목',
60 '금', '토'
61 );
62
63 if (!$wgCachedMessageArrays) {
64 require_once('MessagesKo.php');
65 }
66
67 class LanguageKo extends LanguageUtf8 {
68
69 function getBookstoreList() {
70 global $wgBookstoreListKo;
71 return $wgBookstoreListKo;
72 }
73
74 function getNamespaces() {
75 global $wgNamespaceNamesKo;
76 return $wgNamespaceNamesKo;
77 }
78
79 function getQuickbarSettings() {
80 global $wgQuickbarSettingsKo;
81 return $wgQuickbarSettingsKo;
82 }
83
84 function getSkinNames() {
85 global $wgSkinNamesKo;
86 return $wgSkinNamesKo;
87 }
88
89 function getDateFormats() {
90 return false;
91 }
92
93 function date( $ts, $adj = false ) {
94 global $wgWeekdayAbbreviationsKo;
95 if ( $adj ) { $ts = $this->userAdjust( $ts ); }
96
97 # This is horribly inefficient; I need to rework this
98 $x = getdate(mktime(( (int)substr( $ts, 8, 2) ),
99 (int)substr( $ts, 10, 2 ), (int)substr( $ts, 12, 2 ),
100 (int)substr( $ts, 4, 2 ), (int)substr( $ts, 6, 2 ),
101 (int)substr( $ts, 0, 4 )));
102
103 $d = substr( $ts, 0, 4 ) . "년 " .
104 $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . "월 " .
105 (0 + substr( $ts, 6, 2 )) . "일 " .
106 "(" . $wgWeekdayAbbreviationsKo[$x["wday"]] . ")";
107 return $d;
108 }
109
110 function timeanddate( $ts, $adj = false ) {
111 return $this->date( $ts, $adj ) . " " . $this->time( $ts, $adj );
112 }
113
114 function getMessage( $key ) {
115 global $wgAllMessagesKo;
116 return isset($wgAllMessagesKo[$key]) ? $wgAllMessagesKo[$key] : parent::getMessage($key);
117 }
118
119 function firstChar( $s ) {
120 preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
121 '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})/', $s, $matches);
122
123 if ( isset( $matches[1] ) ) {
124 if ( strlen( $matches[1] ) != 3 ) {
125 return $matches[1];
126 }
127 $code = (ord($matches[1]{0}) & 0x0f) << 12;
128 $code |= (ord($matches[1]{1}) & 0x3f) << 6;
129 $code |= (ord($matches[1]{2}) & 0x3f);
130 if ( $code < 0xac00 || 0xd7a4 <= $code) {
131 return $matches[1];
132 } elseif ( $code < 0xb098 ) {
133 return "\xe3\x84\xb1";
134 } elseif ( $code < 0xb2e4 ) {
135 return "\xe3\x84\xb4";
136 } elseif ( $code < 0xb77c ) {
137 return "\xe3\x84\xb7";
138 } elseif ( $code < 0xb9c8 ) {
139 return "\xe3\x84\xb9";
140 } elseif ( $code < 0xbc14 ) {
141 return "\xe3\x85\x81";
142 } elseif ( $code < 0xc0ac ) {
143 return "\xe3\x85\x82";
144 } elseif ( $code < 0xc544 ) {
145 return "\xe3\x85\x85";
146 } elseif ( $code < 0xc790 ) {
147 return "\xe3\x85\x87";
148 } elseif ( $code < 0xcc28 ) {
149 return "\xe3\x85\x88";
150 } elseif ( $code < 0xce74 ) {
151 return "\xe3\x85\x8a";
152 } elseif ( $code < 0xd0c0 ) {
153 return "\xe3\x85\x8b";
154 } elseif ( $code < 0xd30c ) {
155 return "\xe3\x85\x8c";
156 } elseif ( $code < 0xd558 ) {
157 return "\xe3\x85\x8d";
158 } else {
159 return "\xe3\x85\x8e";
160 }
161 } else {
162 return "";
163 }
164 }
165 }
166
167 ?>