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