9 require_once( 'LanguageUtf8.php' );
11 if (!$wgCachedMessageArrays) {
12 require_once('MessagesEt.php');
15 class LanguageEt
extends LanguageUtf8
{
16 private $mMessagesEt, $mNamespaceNamesEt = null;
18 private $mSkinNamesEt = array(
19 'standard' => 'Standard',
20 'nostalgia' => 'Nostalgia',
21 'cologneblue' => 'Kölni sinine',
22 'smarty' => 'Paddington',
23 'montparnasse' => 'Montparnasse',
24 'davinci' => 'DaVinci',
26 'monobook' => 'MonoBook',
27 'myskin' => 'Mu oma nahk'
30 private $mDateFormatsEt = array(
32 '15.01.2001, kell 16.12',
33 '15. jaanuar 2001, kell 16.12',
34 '15. I 2005, kell 16.12',
35 'ISO 8601' => '2001-01-15 16:12:34'
38 private $mQuickbarSettingsEt = array(
39 'Ei_ole', 'Püsivalt_vasakul', 'Püsivalt paremal', 'Ujuvalt vasakul'
42 #Lisasin eestimaised poed, aga võõramaiseid ei julenud kustutada.
44 private $mBookstoreListEt = array(
45 'Apollo' => 'http://www.apollo.ee/search.php?keyword=$1&search=OTSI',
46 'minu Raamat' => 'http://www.raamat.ee/advanced_search_result.php?keywords=$1',
47 'Raamatukoi' => 'http://www.raamatukoi.ee/cgi-bin/index?valik=otsing&paring=$1',
48 'AddALL' => 'http://www.addall.com/New/Partner.cgi?query=$1&type=ISBN',
49 'PriceSCAN' => 'http://www.pricescan.com/books/bookDetail.asp?isbn=$1',
50 'Barnes & Noble' => 'http://search.barnesandnoble.com/bookSearch/isbnInquiry.asp?isbn=$1',
51 'Amazon.com' => 'http://www.amazon.com/exec/obidos/ISBN=$1'
55 private $mMagicWordsEt = array(
57 'redirect' => array( 0, '#redirect', "#suuna" ),
60 function __construct() {
61 parent
::__construct();
63 global $wgAllMessagesEt;
64 $this->mMessagesEt
=& $wgAllMessagesEt;
66 global $wgMetaNamespace;
67 $this->mNamespaceNamesEt
= array(
72 NS_USER
=> 'Kasutaja',
73 NS_USER_TALK
=> 'Kasutaja_arutelu',
74 NS_PROJECT
=> $wgMetaNamespace,
75 NS_PROJECT_TALK
=> $wgMetaNamespace . '_arutelu',
77 NS_IMAGE_TALK
=> 'Pildi_arutelu',
78 NS_MEDIAWIKI
=> 'MediaWiki',
79 NS_MEDIAWIKI_TALK
=> 'MediaWiki_arutelu',
80 NS_TEMPLATE
=> 'Mall',
81 NS_TEMPLATE_TALK
=> 'Malli_arutelu',
83 NS_HELP_TALK
=> 'Juhendi_arutelu',
84 NS_CATEGORY
=> 'Kategooria',
85 NS_CATEGORY_TALK
=> 'Kategooria_arutelu'
90 function getNamespaces() {
91 return $this->mNamespaceNamesEt + parent
::getNamespaces();
94 function getQuickbarSettings() {
95 return $this->mQuickbarSettingsEt
;
98 function getSkinNames() {
99 return $this->mSkinNamesEt + parent
::getSkinNames();
102 function getDateFormats() {
103 return $this->mDateFormatsEt
;
106 function getBookstoreList() {
107 return $this->mBookstoreListEt
;
110 function &getMagicWords() {
111 $t = $this->mMagicWordsEt + parent
::getMagicWords();
115 function getMessage( $key ) {
116 if( isset( $this->mMessagesEt
[$key] ) ) {
117 return $this->mMessagesEt
[$key];
119 return parent
::getMessage( $key );
123 function getAllMessages() {
124 return $this->mMessagesEt
;
128 * Estonian numeric formatting is 123 456,78.
129 * Notice that the space is non-breaking.
131 function separatorTransformTable() {
132 return array(',' => "\xc2\xa0", '.' => ',' );
136 * Avoid grouping whole numbers between 0 to 9999
138 function commafy($_) {
139 if (!preg_match('/^\d{1,4}$/',$_)) {
140 return strrev((string)preg_replace('/(\d{3})(?=\d)(?!\d*\.)/','$1,',strrev($_)));
148 * @param mixed $ts the time format which needs to be turned into a
149 * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
150 * @param bool $adj whether to adjust the time output according to the
151 * user configured offset ($timecorrection)
152 * @param mixed $format what format to return, if it's false output the
154 * @param string $timecorrection the time offset as returned by
155 * validateTimeZone() in Special:Preferences
158 function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
159 global $wgAmericanDates;
161 if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); }
163 $datePreference = $this->dateFormat($format);
165 if ($datePreference == '0'
166 ||
$datePreference == '' ) {$datePreference = $wgAmericanDates ?
'0' : '2';}
168 $month = $this->getMonthName( substr( $ts, 4, 2 ) );
169 $day = $this->formatNum( 0 +
substr( $ts, 6, 2 ) );
170 $year = $this->formatNum( substr( $ts, 0, 4 ), true );
171 $lat_month = $this->monthByLatinNumber( substr ($ts, 4, 2));
173 switch( $datePreference ) {
174 case '2': return "$day. $month $year";
175 case '3': return "$day. $lat_month $year";
176 case 'ISO 8601': return substr($ts, 0, 4). '-' . substr($ts, 4, 2). '-' .substr($ts, 6, 2);
177 default: return substr($ts, 6, 2). '.' . substr($ts, 4, 2). '.' .substr($ts, 0, 4);
183 * @param mixed $ts the time format which needs to be turned into a
184 * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
185 * @param bool $adj whether to adjust the time output according to the
186 * user configured offset ($timecorrection)
187 * @param mixed $format what format to return, if it's false output the
188 * default one (default true)
189 * @param string $timecorrection the time offset as returned by
190 * validateTimeZone() in Special:Preferences
193 function time( $ts, $adj = false, $format = true, $timecorrection = false ) {
194 global $wgUser, $wgAmericanDates;
196 if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); }
197 $datePreference = $this->dateFormat($format);
199 if ($datePreference == '0') {$datePreference = $wgAmericanDates ?
'0' : '2';}
201 if ( $datePreference === 'ISO 8601' ) {
202 $t = substr( $ts, 8, 2 ) . ':' . substr( $ts, 10, 2 );
203 $t .= ':' . substr( $ts, 12, 2 );
205 $t = substr( $ts, 8, 2 ) . '.' . substr( $ts, 10, 2 );
212 * @param mixed $ts the time format which needs to be turned into a
213 * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
214 * @param bool $adj whether to adjust the time output according to the
215 * user configured offset ($timecorrection)
216 * @param mixed $format what format to return, if it's false output the
217 * default one (default true)
218 * @param string $timecorrection the time offset as returned by
219 * validateTimeZone() in Special:Preferences
222 function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false) {
223 global $wgUser, $wgAmericanDates;
225 $datePreference = $this->dateFormat($format);
226 switch ( $datePreference ) {
227 case 'ISO 8601': return $this->date( $ts, $adj, $datePreference, $timecorrection ) . ' ' .
228 $this->time( $ts, $adj, $datePreference, $timecorrection );
229 default: return $this->date( $ts, $adj, $datePreference, $timecorrection ) . ', kell ' .
230 $this->time( $ts, $adj, $datePreference, $timecorrection );
237 * retuns latin number corresponding to given month number
242 function monthByLatinNumber( $key ) {
243 $latinNumbers= array(
244 'I', 'II', 'III', 'IV', 'V', 'VI',
245 'VII','VIII','IX','X','XI','XII'
248 return $latinNumbers[$key-1];