6 * @author Niklas Laxström
8 class LanguageFi
extends Language
{
10 * Avoid grouping whole numbers between 0 to 9999
12 function commafy($_) {
13 if (!preg_match('/^\d{1,4}$/',$_)) {
14 return strrev((string)preg_replace('/(\d{3})(?=\d)(?!\d*\.)/','$1,',strrev($_)));
20 # Convert from the nominative form of a noun to some other case
21 # Invoked with {{GRAMMAR:case|word}}
22 function convertGrammar( $word, $case ) {
23 global $wgGrammarForms;
24 if ( isset($wgGrammarForms['fi'][$case][$word]) ) {
25 return $wgGrammarForms['fi'][$case][$word];
28 # These rules are not perfect, but they are currently only used for site names so it doesn't
29 # matter if they are wrong sometimes. Just add a special case for your site name if necessary.
32 $aou = preg_match( '/[aou][^äöy]*$/i', $word );
34 # append i after final consonant
35 if ( preg_match( '/[bcdfghjklmnpqrstvwxz]$/i', $word ) )
43 $word .= ($aou ?
'sta' : 'stä');
46 $word .= ($aou ?
'a' : 'ä');
49 # Double the last letter and add 'n'
50 # mb_substr has a compatibility function in GlobalFunctions.php
51 $word = $word . mb_substr($word, -1) . 'n';
54 $word .= ($aou ?
'ssa' : 'ssä');
60 function translateBlockExpiry( $str ) {
62 'ago', 'now', 'today', 'this', 'next',
63 'first', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'eighth', 'ninth', 'tenth', 'eleventh', 'twelfth',
64 'tomorrow', 'yesterday'
66 $months = 'january:tammikuu,february:helmikuu,march:maaliskuu,april:huhtikuu,may:toukokuu,june:kesäkuu,' .
67 'july:heinäkuu,august:elokuu,september:syyskuu,october:lokakuu,november:marraskuu,december:joulukuu,' .
68 'jan:tammikuu,feb:helmikuu,mar:maaliskuu,apr:huhtikuu,jun:kesäkuu,jul:heinäkuu,aug:elokuu,sep:syyskuu,'.
69 'oct:lokakuu,nov:marraskuu,dec:joulukuu,sept:syyskuu';
72 'monday' => 'maanantai',
73 'tuesday' => 'tiistai',
74 'wednesday' => 'keskiviikko',
75 'thursay' => 'torstai',
76 'friday' => 'perjantai',
77 'saturday' => 'lauantai',
78 'sunday' => 'sunnuntai',
91 'tomorrow' => 'huomenna',
93 'seconds' => 'sekuntia',
94 'second' => 'sekunti',
97 'minutes' => 'minuuttia',
98 'minute' => 'minuutti',
105 'weeks' => 'viikkoa',
107 'fortnights' => 'tuplaviikkoa',
108 'fortnight' => 'tuplaviikko',
109 'months' => 'kuukautta',
110 'month' => 'kuukausi',
113 'infinite' => 'ikuisesti',
114 'indefinite' => 'ikuisesti'
118 $tokens = explode ( ' ', $str);
119 foreach( $tokens as $item ) {
120 if ( !is_numeric($item) ) {
121 if ( count ( explode( '-', $item ) ) == 3 && strlen($item) == 10 ) {
122 list( $yyyy, $mm, $dd ) = explode( '-', $item );
123 $final .= ' ' . $this->date( "{$yyyy}{$mm}{$dd}00000000");
126 if( isset( $weekds[$item] ) ) {
127 $final .= ' ' . $weekds[$item];
132 $final .= ' ' . $item;
134 return '<span class="blockexpiry" title="' . htmlspecialchars($str). '">”' . trim( $final ) . '”</span>';