8 require_once( 'LanguageUtf8.php' );
10 # Revised 2005-12-24 for MediaWiki 1.6dev -- Nikerabbit
12 /* private */ $wgNamespaceNamesFi = array(
14 NS_SPECIAL
=> 'Toiminnot',
16 NS_TALK
=> 'Keskustelu',
17 NS_USER
=> 'Käyttäjä',
18 NS_USER_TALK
=> 'Keskustelu_käyttäjästä',
19 NS_PROJECT
=> $wgMetaNamespace,
20 NS_PROJECT_TALK
=> FALSE, # Set in constructor
22 NS_IMAGE_TALK
=> 'Keskustelu_kuvasta',
23 NS_MEDIAWIKI
=> 'MediaWiki',
24 NS_MEDIAWIKI_TALK
=> 'MediaWiki_talk',
25 NS_TEMPLATE
=> 'Malline',
26 NS_TEMPLATE_TALK
=> 'Keskustelu_mallineesta',
28 NS_HELP_TALK
=> 'Keskustelu_ohjeesta',
29 NS_CATEGORY
=> 'Luokka',
30 NS_CATEGORY_TALK
=> 'Keskustelu_luokasta'
32 ) +
$wgNamespaceNamesEn;
34 /* private */ $wgQuickbarSettingsFi = array(
35 'Ei mitään', 'Tekstin mukana, vasen', 'Tekstin mukana, oikea', 'Pysyen vasemmalla'
38 /* private */ $wgSkinNamesFi = array(
39 'standard' => 'Perus',
40 'cologneblue' => 'Kölnin sininen',
41 'myskin' => 'Oma tyylisivu'
44 /* private */ $wgDateFormatsFi = array(
45 MW_DATE_DEFAULT
=> 'Ei valintaa',
46 1 => '15. tammikuuta 2001 kello 16.12',
47 2 => '15. tammikuuta 2001 kello 16:12:34',
48 3 => '15.1.2001 16.12',
49 MW_DATE_ISO
=> '2001-01-15 16:12:34'
52 /* private */ $wgBookstoreListFi = array(
53 'Akateeminen kirjakauppa' => 'http://www.akateeminen.com/search/tuotetieto.asp?tuotenro=$1',
54 'Bookplus' => 'http://www.bookplus.fi/product.php?isbn=$1',
55 'Helsingin yliopiston kirjasto' => 'http://pandora.lib.hel.fi/cgi-bin/mhask/monihask.py?volname=&author=&keyword=&ident=$1&submit=Hae&engine_helka=ON',
56 'Pääkaupunkiseudun kirjastot' => 'http://www.helmet.fi/search*fin/i?SEARCH=$1',
57 'Tampereen seudun kirjastot' => 'http://pandora.lib.hel.fi/cgi-bin/mhask/monihask.py?volname=&author=&keyword=&ident=$1-1&lang=kaikki&mat_type=kaikki&submit=Hae&engine_tampere=ON'
58 ) +
$wgBookstoreListEn;
60 # Current practices (may be changed if not good ones)
61 # Refer namespaces with the English name or 'Project' in case of project namespace
62 # Avoid any hard coded references to any particular subject which may not apply everywhere, e.g. artikkeli, wikipedia
63 # Don't use participial phrases (lauseenkastikkeita) incorrectly
64 # Avoid unnecessary parenthesis, quotes and html code
67 if (!$wgCachedMessageArrays) {
68 require_once('MessagesFi.php');
71 #--------------------------------------------------------------------------
72 # Internationalisation code
73 #--------------------------------------------------------------------------
75 class LanguageFi
extends LanguageUtf8
{
76 function LanguageFi() {
77 global $wgNamespaceNamesFi, $wgMetaNamespace;
78 LanguageUtf8
::LanguageUtf8();
79 $wgNamespaceNamesFi[NS_PROJECT_TALK
] = 'Keskustelu_' . $this->convertGrammar( $wgMetaNamespace, 'elative' );
82 function getBookstoreList () {
83 global $wgBookstoreListFi ;
84 return $wgBookstoreListFi ;
87 function getNamespaces() {
88 global $wgNamespaceNamesFi;
89 return $wgNamespaceNamesFi;
92 function getQuickbarSettings() {
93 global $wgQuickbarSettingsFi;
94 return $wgQuickbarSettingsFi;
97 function getSkinNames() {
98 global $wgSkinNamesFi;
99 return $wgSkinNamesFi;
102 function getDateFormats() {
103 global $wgDateFormatsFi;
104 return $wgDateFormatsFi;
108 * See Language.php for documentation
110 function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
111 if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); }
113 $yyyy = substr( $ts, 0, 4 );
114 $mm = substr( $ts, 4, 2 );
116 $mmmm = $this->getMonthName( $mm ) . 'ta';
117 $dd = substr( $ts, 6, 2 );
120 $datePreference = $this->dateFormat($format);
121 switch( $datePreference ) {
122 case '3': return "$d.$m.$yyyy";
123 case MW_DATE_ISO
: return "$yyyy-$mm-$dd";
124 default: return "$d. $mmmm $yyyy";
129 * See Language.php for documentation
131 function time( $ts, $adj = false, $format = true, $timecorrection = false ) {
132 if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); }
134 $hh = substr( $ts, 8, 2 );
135 $mm = substr( $ts, 10, 2 );
136 $ss = substr( $ts, 12, 2 );
138 $datePreference = $this->dateFormat($format);
139 switch( $datePreference ) {
141 case MW_DATE_ISO
: return "$hh:$mm:$ss";
142 default: return "$hh.$mm";
147 * See Language.php for documentation
149 function timeanddate( $ts, $adj = false, $format = true, $timecorrection = false) {
150 $date = $this->date( $ts, $adj, $format, $timecorrection );
151 $time = $this->time( $ts, $adj, $format, $timecorrection );
153 $datePreference = $this->dateFormat($format);
154 switch( $datePreference ) {
156 case MW_DATE_ISO
: return "$date $time";
157 default: return "$date kello $time";
161 function getMessage( $key ) {
162 global $wgAllMessagesFi;
163 if( isset( $wgAllMessagesFi[$key] ) ) {
164 return $wgAllMessagesFi[$key];
166 return parent
::getMessage( $key );
171 * Finnish numeric formatting is 123 456,78.
173 function separatorTransformTable() {
174 return array(',' => "\xc2\xa0", '.' => ',' );
178 * Avoid grouping whole numbers between 0 to 9999
180 function commafy($_) {
181 if (!preg_match('/^\d{1,4}$/',$_)) {
182 return strrev((string)preg_replace('/(\d{3})(?=\d)(?!\d*\.)/','$1,',strrev($_)));
188 function linkTrail() {
189 return '/^([a-zäö]+)(.*)$/sDu';
193 # Convert from the nominative form of a noun to some other case
194 # Invoked with {{GRAMMAR:case|word}}
195 function convertGrammar( $word, $case ) {
196 global $wgGrammarForms;
197 if ( isset($wgGrammarForms['fi'][$case][$word]) ) {
198 return $wgGrammarForms['fi'][$case][$word];
201 # These rules are not perfect, but they are currently only used for site names so it doesn't
202 # matter if they are wrong sometimes. Just add a special case for your site name if necessary.
205 if ( $word == 'Wikisitaatit' ) {
206 $word = 'Wikisitaattien';
212 if ( $word == 'Wikisitaatit' ) {
213 $word = 'Wikisitaateista';
215 if ( mb_substr($word, -1) == 'y' ) {
223 if ( $word == 'Wikisitaatit' ) {
224 $word = 'Wikisitaatteja';
226 if ( mb_substr($word, -1) == 'y' ) {
234 # Double the last letter and add 'n'
235 # mb_substr has a compatibility function in GlobalFunctions.php
236 if ( $word == 'Wikisitaatit' ) {
237 $word = 'Wikisitaatteihin';
239 $word = $word . mb_substr($word,-1) . 'n';
243 if ( $word == 'Wikisitaatit' ) {
244 $word = 'Wikisitaateissa';
246 if ( mb_substr($word, -1) == 'y' ) {
258 function translateBlockExpiry( $str ) {
260 'ago', 'now', 'today', 'this', 'next',
261 'first', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'eighth', 'ninth', 'tenth', 'eleventh', 'twelfth',
262 'tomorrow', 'yesterday'
264 $months = 'january:tammikuu,february:helmikuu,march:maaliskuu,april:huhtikuu,may:toukokuu,june:kesäkuu,' .
265 'july:heinäkuu,august:elokuu,september:syyskuu,october:lokakuu,november:marraskuu,december:joulukuu,' .
266 'jan:tammikuu,feb:helmikuu,mar:maaliskuu,apr:huhtikuu,jun:kesäkuu,jul:heinäkuu,aug:elokuu,sep:syyskuu,'.
267 'oct:lokakuu,nov:marraskuu,dec:joulukuu,sept:syyskuu';
270 'monday' => 'maanantai',
271 'tuesday' => 'tiistai',
272 'wednesday' => 'keskiviikko',
273 'thursay' => 'torstai',
274 'friday' => 'perjantai',
275 'saturday' => 'lauantai',
276 'sunday' => 'sunnuntai',
288 'next' => 'seuraava',
289 'tomorrow' => 'huomenna',
291 'seconds' => 'sekuntia',
292 'second' => 'sekunti',
295 'minutes' => 'minuuttia',
296 'minute' => 'minuutti',
303 'weeks' => 'viikkoa',
305 'fortnights' => 'tuplaviikkoa',
306 'fortnight' => 'tuplaviikko',
307 'months' => 'kuukautta',
308 'month' => 'kuukausi',
311 'infinite' => 'ikuisesti',
312 'indefinite' => 'ikuisesti'
316 $tokens = explode ( ' ', $str);
317 foreach( $tokens as $item ) {
318 if ( !is_numeric($item) ) {
319 if ( count ( explode( '-', $item ) ) == 3 && strlen($item) == 10 ) {
320 list( $yyyy, $mm, $dd ) = explode( '-', $item );
321 $final .= ' ' . $this->date( "{$yyyy}{$mm}{$dd}00000000");
324 if( isset( $weekds[$item] ) ) {
325 $final .= ' ' . $weekds[$item];
330 $final .= ' ' . $item;
332 return '<span class="blockexpiry" title="' . htmlspecialchars($str). '">”' . trim( $final ) . '”</span>';