7 * @author Niklas Laxström
9 class LanguageFi
extends Language
{
11 # Convert from the nominative form of a noun to some other case
12 # Invoked with {{GRAMMAR:case|word}}
13 function convertGrammar( $word, $case ) {
14 global $wgGrammarForms;
15 if ( isset($wgGrammarForms['fi'][$case][$word]) ) {
16 return $wgGrammarForms['fi'][$case][$word];
19 # These rules are not perfect, but they are currently only used for site names so it doesn't
20 # matter if they are wrong sometimes. Just add a special case for your site name if necessary.
23 $aou = preg_match( '/[aou][^äöy]*$/i', $word );
25 # The flag should be false for compounds where the last word has only neutral vowels (e/i).
26 # The general case cannot be handled without a dictionary, but there's at least one notable
27 # special case we should check for:
29 if ( preg_match( '/wiki$/i', $word ) )
32 # append i after final consonant
33 if ( preg_match( '/[bcdfghjklmnpqrstvwxz]$/i', $word ) )
41 $word .= ($aou ?
'sta' : 'stä');
44 $word .= ($aou ?
'a' : 'ä');
47 # Double the last letter and add 'n'
48 # mb_substr has a compatibility function in GlobalFunctions.php
49 $word = $word . mb_substr($word, -1) . 'n';
52 $word .= ($aou ?
'ssa' : 'ssä');
58 function translateBlockExpiry( $str, $forContent = false ) {
60 'ago', 'now', 'today', 'this', 'next',
61 'first', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'eighth', 'ninth', 'tenth', 'eleventh', 'twelfth',
62 'tomorrow', 'yesterday'
64 $months = 'january:tammikuu,february:helmikuu,march:maaliskuu,april:huhtikuu,may:toukokuu,june:kesäkuu,' .
65 'july:heinäkuu,august:elokuu,september:syyskuu,october:lokakuu,november:marraskuu,december:joulukuu,' .
66 'jan:tammikuu,feb:helmikuu,mar:maaliskuu,apr:huhtikuu,jun:kesäkuu,jul:heinäkuu,aug:elokuu,sep:syyskuu,'.
67 'oct:lokakuu,nov:marraskuu,dec:joulukuu,sept:syyskuu';
70 'monday' => 'maanantai',
71 'tuesday' => 'tiistai',
72 'wednesday' => 'keskiviikko',
73 'thursay' => 'torstai',
74 'friday' => 'perjantai',
75 'saturday' => 'lauantai',
76 'sunday' => 'sunnuntai',
89 'tomorrow' => 'huomenna',
91 'seconds' => 'sekuntia',
92 'second' => 'sekunti',
95 'minutes' => 'minuuttia',
96 'minute' => 'minuutti',
103 'weeks' => 'viikkoa',
105 'fortnights' => 'tuplaviikkoa',
106 'fortnight' => 'tuplaviikko',
107 'months' => 'kuukautta',
108 'month' => 'kuukausi',
111 'infinite' => 'ikuisesti',
112 'indefinite' => 'ikuisesti'
116 $tokens = explode ( ' ', $str);
117 foreach( $tokens as $item ) {
118 if ( !is_numeric($item) ) {
119 if ( count ( explode( '-', $item ) ) == 3 && strlen($item) == 10 ) {
120 list( $yyyy, $mm, $dd ) = explode( '-', $item );
121 $final .= ' ' . $this->date( "{$yyyy}{$mm}{$dd}00000000");
124 if( isset( $weekds[$item] ) ) {
125 $final .= ' ' . $weekds[$item];
130 $final .= ' ' . $item;
133 return htmlspecialchars( trim( $final ) );