(bug 4860) Expose Title->userCan() as Hooks
[lhc/web/wiklou.git] / languages / LanguageEt.php
1 <?php
2 /**
3 * @package MediaWiki
4 * @subpackage Language
5 */
6
7 $wgNamespaceNamesEt = array(
8 NS_MEDIA => 'Meedia',
9 NS_SPECIAL => 'Eri',
10 NS_MAIN => '',
11 NS_TALK => 'Arutelu',
12 NS_USER => 'Kasutaja',
13 NS_USER_TALK => 'Kasutaja_arutelu',
14 NS_PROJECT => $wgMetaNamespace,
15 NS_PROJECT_TALK => $wgMetaNamespace . '_arutelu',
16 NS_IMAGE => 'Pilt',
17 NS_IMAGE_TALK => 'Pildi_arutelu',
18 NS_MEDIAWIKI => 'MediaWiki',
19 NS_MEDIAWIKI_TALK => 'MediaWiki_arutelu',
20 NS_TEMPLATE => 'Mall',
21 NS_TEMPLATE_TALK => 'Malli_arutelu',
22 NS_HELP => 'Juhend',
23 NS_HELP_TALK => 'Juhendi_arutelu',
24 NS_CATEGORY => 'Kategooria',
25 NS_CATEGORY_TALK => 'Kategooria_arutelu'
26 ) + $wgNamespaceNamesEn;
27
28 /* private */ $wgSkinNamesEt = array(
29 'standard' => "Standard",
30 'nostalgia' => "Nostalgia",
31 'cologneblue' => "Kölni sinine",
32 'smarty' => "Paddington",
33 'montparnasse' => "Montparnasse",
34 'davinci' => "DaVinci",
35 'mono' => "Mono",
36 'monobook' => "MonoBook",
37 "myskin" => "Mu oma nahk"
38 );
39
40
41 /* private */ $wgDateFormatsEt = array(
42 'Eelistus puudub',
43 '15.01.2001, kell 16.12',
44 '15. jaanuar 2001, kell 16.12',
45 '15. I 2005, kell 16.12',
46 'ISO 8601' => '2001-01-15 16:12:34'
47 );
48
49
50 /* private */ $wgQuickbarSettingsEt = array(
51 "Ei_ole", "Püsivalt_vasakul", "Püsivalt paremal", "Ujuvalt vasakul"
52 );
53
54 #Lisasin eestimaised poed, aga võõramaiseid ei julenud kustutada.
55
56
57 /* private */ $wgBookstoreListEt = array(
58 "Apollo" => "http://www.apollo.ee/search.php?keyword=$1&search=OTSI",
59 "minu Raamat" => "http://www.raamat.ee/advanced_search_result.php?keywords=$1",
60 "Raamatukoi" => "http://www.raamatukoi.ee/cgi-bin/index?valik=otsing&paring=$1",
61 "AddALL" => "http://www.addall.com/New/Partner.cgi?query=$1&type=ISBN",
62 "PriceSCAN" => "http://www.pricescan.com/books/bookDetail.asp?isbn=$1",
63 "Barnes & Noble" => "http://search.barnesandnoble.com/bookSearch/isbnInquiry.asp?isbn=$1",
64 "Amazon.com" => "http://www.amazon.com/exec/obidos/ISBN=$1"
65 );
66
67
68 /* private */ $wgMagicWordsEt = array(
69 # ID CASE SYNONYMS
70 MAG_REDIRECT => array( 0, '#redirect', "#suuna" ),
71 MAG_NOTOC => array( 0, '__NOTOC__' ),
72 MAG_FORCETOC => array( 0, '__FORCETOC__' ),
73 MAG_TOC => array( 0, '__TOC__' ),
74 MAG_NOEDITSECTION => array( 0, '__NOEDITSECTION__' ),
75 MAG_START => array( 0, '__START__' ),
76 MAG_CURRENTMONTH => array( 1, 'CURRENTMONTH' ),
77 MAG_CURRENTMONTHNAME => array( 1, 'CURRENTMONTHNAME' ),
78 MAG_CURRENTDAY => array( 1, 'CURRENTDAY' ),
79 MAG_CURRENTDAYNAME => array( 1, 'CURRENTDAYNAME' ),
80 MAG_CURRENTYEAR => array( 1, 'CURRENTYEAR' ),
81 MAG_CURRENTTIME => array( 1, 'CURRENTTIME' ),
82 MAG_NUMBEROFARTICLES => array( 1, 'NUMBEROFARTICLES' ),
83 MAG_CURRENTMONTHNAMEGEN => array( 1, 'CURRENTMONTHNAMEGEN' ),
84 MAG_PAGENAME => array( 1, 'PAGENAME' ),
85 MAG_PAGENAMEE => array( 1, 'PAGENAMEE' ),
86 MAG_NAMESPACE => array( 1, 'NAMESPACE' ),
87 MAG_SUBST => array( 0, 'SUBST:' ),
88 MAG_MSGNW => array( 0, 'MSGNW:' ),
89 MAG_END => array( 0, '__END__' ),
90 MAG_IMG_THUMBNAIL => array( 1, 'thumbnail', 'thumb' ),
91 MAG_IMG_RIGHT => array( 1, 'right' ),
92 MAG_IMG_LEFT => array( 1, 'left' ),
93 MAG_IMG_NONE => array( 1, 'none' ),
94 MAG_IMG_WIDTH => array( 1, '$1px' ),
95 MAG_IMG_CENTER => array( 1, 'center', 'centre' ),
96 MAG_IMG_FRAMED => array( 1, 'framed', 'enframed', 'frame' ),
97 MAG_INT => array( 0, 'INT:' ),
98 MAG_SITENAME => array( 1, 'SITENAME' ),
99 MAG_NS => array( 0, 'NS:' ),
100 MAG_LOCALURL => array( 0, 'LOCALURL:' ),
101 MAG_LOCALURLE => array( 0, 'LOCALURLE:' ),
102 MAG_SERVER => array( 0, 'SERVER' ),
103 MAG_GRAMMAR => array( 0, 'GRAMMAR:' )
104 );
105
106
107 if (!$wgCachedMessageArrays) {
108 require_once('MessagesEt.php');
109 }
110
111 require_once( "LanguageUtf8.php" );
112
113 class LanguageEt extends LanguageUtf8 {
114
115
116 function getBookstoreList () {
117 global $wgBookstoreListEt ;
118 return $wgBookstoreListEt ;
119 }
120
121 function getDateFormats() {
122 global $wgDateFormatsEt;
123 return $wgDateFormatsEt;
124 }
125
126 function getNamespaces() {
127 global $wgNamespaceNamesEt;
128 return $wgNamespaceNamesEt;
129 }
130
131 function getQuickbarSettings() {
132 global $wgQuickbarSettingsEt;
133 return $wgQuickbarSettingsEt;
134 }
135
136 function getSkinNames() {
137 global $wgSkinNamesEt;
138 return $wgSkinNamesEt;
139 }
140
141 function getMessage( $key ) {
142 global $wgAllMessagesEt;
143 if( isset( $wgAllMessagesEt[$key] ) ) {
144 return $wgAllMessagesEt[$key];
145 } else {
146 return parent::getMessage( $key );
147 }
148 }
149
150 /**
151 * Estonian numeric formatting is 123 456,78.
152 * Notice that the space is non-breaking.
153 */
154 function formatNum( $number, $year = false ) {
155 return $year ? $number : strtr($this->commafy($number), '.,', ", " );
156 }
157
158 /**
159 * Avoid grouping whole numbers between 0 to 9999
160 */
161 function commafy($_) {
162 if (!preg_match('/^\d{1,4}$/',$_)) {
163 return strrev((string)preg_replace('/(\d{3})(?=\d)(?!\d*\.)/','$1,',strrev($_)));
164 } else {
165 return $_;
166 }
167 }
168
169
170
171
172 /**
173 * @access public
174 * @param mixed $ts the time format which needs to be turned into a
175 * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
176 * @param bool $adj whether to adjust the time output according to the
177 * user configured offset ($timecorrection)
178 * @param mixed $format what format to return, if it's false output the
179 * default one.
180 * @param string $timecorrection the time offset as returned by
181 * validateTimeZone() in Special:Preferences
182 * @return string
183 */
184 function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
185 global $wgAmericanDates, $wgUser;
186
187 if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); }
188
189 $datePreference = $this->dateFormat($format);
190
191 if ($datePreference == '0'
192 || $datePreference == '' ) {$datePreference = $wgAmericanDates ? '0' : '2';}
193
194 $month = $this->getMonthName( substr( $ts, 4, 2 ) );
195 $day = $this->formatNum( 0 + substr( $ts, 6, 2 ) );
196 $year = $this->formatNum( substr( $ts, 0, 4 ), true );
197 $lat_month = $this->monthByLatinNumber( substr ($ts, 4, 2));
198
199 switch( $datePreference ) {
200 case '2': return "$day. $month $year";
201 case '3': return "$day. $lat_month $year";
202 case 'ISO 8601': return substr($ts, 0, 4). '-' . substr($ts, 4, 2). '-' .substr($ts, 6, 2);
203 default: return substr($ts, 6, 2). '.' . substr($ts, 4, 2). '.' .substr($ts, 0, 4);
204 }
205 }
206
207
208
209 /**
210 * @access public
211 * @param mixed $ts the time format which needs to be turned into a
212 * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
213 * @param bool $adj whether to adjust the time output according to the
214 * user configured offset ($timecorrection)
215 * @param mixed $format what format to return, if it's false output the
216 * default one (default true)
217 * @param string $timecorrection the time offset as returned by
218 * validateTimeZone() in Special:Preferences
219 * @return string
220 */
221 function time( $ts, $adj = false, $format = true, $timecorrection = false ) {
222 global $wgUser, $wgAmericanDates;
223
224 if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); }
225 $datePreference = $this->dateFormat($format);
226
227 if ($datePreference == '0') {$datePreference = $wgAmericanDates ? '0' : '2';}
228
229 if ( $datePreference === 'ISO 8601' ) {
230 $t = substr( $ts, 8, 2 ) . ':' . substr( $ts, 10, 2 );
231 $t .= ':' . substr( $ts, 12, 2 );
232 } else {
233 $t = substr( $ts, 8, 2 ) . '.' . substr( $ts, 10, 2 );
234 }
235 return $t;
236 }
237
238
239
240
241 /**
242 * @access public
243 * @param mixed $ts the time format which needs to be turned into a
244 * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
245 * @param bool $adj whether to adjust the time output according to the
246 * user configured offset ($timecorrection)
247 * @param mixed $format what format to return, if it's false output the
248 * default one (default true)
249 * @param string $timecorrection the time offset as returned by
250 * validateTimeZone() in Special:Preferences
251 * @return string
252 */
253 function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false) {
254 global $wgUser, $wgAmericanDates;
255
256 $datePreference = $this->dateFormat($format);
257 switch ( $datePreference ) {
258 case 'ISO 8601': return $this->date( $ts, $adj, $datePreference, $timecorrection ) . ' ' .
259 $this->time( $ts, $adj, $datePreference, $timecorrection );
260 default: return $this->date( $ts, $adj, $datePreference, $timecorrection ) . ', kell ' .
261 $this->time( $ts, $adj, $datePreference, $timecorrection );
262
263 }
264
265 }
266
267
268 /**
269 * retuns latin number corresponding to given month number
270 * @access public
271 * @param number
272 * @return string
273 */
274 function monthByLatinNumber( $key ) {
275 $latinNumbers= array(
276 'I', 'II', 'III', 'IV', 'V', 'VI',
277 'VII','VIII','IX','X','XI','XII'
278 );
279
280 return $latinNumbers[$key-1];
281 }
282
283
284 }
285 ?>