7 * @author Niklas Laxström
9 class LanguageFi
extends Language
{
11 * Avoid grouping whole numbers between 0 to 9999
13 function commafy($_) {
14 if (!preg_match('/^\d{1,4}$/',$_)) {
15 return strrev((string)preg_replace('/(\d{3})(?=\d)(?!\d*\.)/','$1,',strrev($_)));
21 # Convert from the nominative form of a noun to some other case
22 # Invoked with {{GRAMMAR:case|word}}
23 function convertGrammar( $word, $case ) {
24 global $wgGrammarForms;
25 if ( isset($wgGrammarForms['fi'][$case][$word]) ) {
26 return $wgGrammarForms['fi'][$case][$word];
29 # These rules are not perfect, but they are currently only used for site names so it doesn't
30 # matter if they are wrong sometimes. Just add a special case for your site name if necessary.
33 if ( $word == 'Wikisitaatit' ) {
34 $word = 'Wikisitaattien';
40 if ( $word == 'Wikisitaatit' ) {
41 $word = 'Wikisitaateista';
43 if ( mb_substr($word, -1) == 'y' ) {
51 if ( $word == 'Wikisitaatit' ) {
52 $word = 'Wikisitaatteja';
54 if ( mb_substr($word, -1) == 'y' ) {
62 # Double the last letter and add 'n'
63 # mb_substr has a compatibility function in GlobalFunctions.php
64 if ( $word == 'Wikisitaatit' ) {
65 $word = 'Wikisitaatteihin';
67 $word = $word . mb_substr($word,-1) . 'n';
71 if ( $word == 'Wikisitaatit' ) {
72 $word = 'Wikisitaateissa';
74 if ( mb_substr($word, -1) == 'y' ) {
86 function translateBlockExpiry( $str ) {
88 'ago', 'now', 'today', 'this', 'next',
89 'first', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'eighth', 'ninth', 'tenth', 'eleventh', 'twelfth',
90 'tomorrow', 'yesterday'
92 $months = 'january:tammikuu,february:helmikuu,march:maaliskuu,april:huhtikuu,may:toukokuu,june:kesäkuu,' .
93 'july:heinäkuu,august:elokuu,september:syyskuu,october:lokakuu,november:marraskuu,december:joulukuu,' .
94 'jan:tammikuu,feb:helmikuu,mar:maaliskuu,apr:huhtikuu,jun:kesäkuu,jul:heinäkuu,aug:elokuu,sep:syyskuu,'.
95 'oct:lokakuu,nov:marraskuu,dec:joulukuu,sept:syyskuu';
98 'monday' => 'maanantai',
99 'tuesday' => 'tiistai',
100 'wednesday' => 'keskiviikko',
101 'thursay' => 'torstai',
102 'friday' => 'perjantai',
103 'saturday' => 'lauantai',
104 'sunday' => 'sunnuntai',
116 'next' => 'seuraava',
117 'tomorrow' => 'huomenna',
119 'seconds' => 'sekuntia',
120 'second' => 'sekunti',
123 'minutes' => 'minuuttia',
124 'minute' => 'minuutti',
131 'weeks' => 'viikkoa',
133 'fortnights' => 'tuplaviikkoa',
134 'fortnight' => 'tuplaviikko',
135 'months' => 'kuukautta',
136 'month' => 'kuukausi',
139 'infinite' => 'ikuisesti',
140 'indefinite' => 'ikuisesti'
144 $tokens = explode ( ' ', $str);
145 foreach( $tokens as $item ) {
146 if ( !is_numeric($item) ) {
147 if ( count ( explode( '-', $item ) ) == 3 && strlen($item) == 10 ) {
148 list( $yyyy, $mm, $dd ) = explode( '-', $item );
149 $final .= ' ' . $this->date( "{$yyyy}{$mm}{$dd}00000000");
152 if( isset( $weekds[$item] ) ) {
153 $final .= ' ' . $weekds[$item];
158 $final .= ' ' . $item;
160 return '<span class="blockexpiry" title="' . htmlspecialchars($str). '">”' . trim( $final ) . '”</span>';