34 MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::GrammarForms );
35 if ( isset( $grammarForms[
'fi'][$case][$word] ) ) {
36 return $grammarForms[
'fi'][$case][$word];
39 # These rules don't cover the whole language.
40 # They are used only for site names.
43 $aou = preg_match(
'/[aou][^äöy]*$/i', $word );
45 # The flag should be false for compounds where the last word has only neutral vowels (e/i).
46 # The general case cannot be handled without a dictionary, but there's at least one notable
47 # special case we should check for:
49 if ( preg_match(
'/wiki$/i', $word ) ) {
53 # append i after final consonant
54 if ( preg_match(
'/[bcdfghjklmnpqrstvwxz]$/i', $word ) ) {
63 $word .= ( $aou ?
'sta' :
'stä' );
66 $word .= ( $aou ?
'a' :
'ä' );
69 # Double the last letter and add 'n'
70 $word .= mb_substr( $word, -1 ) .
'n';
73 $word .= ( $aou ?
'ssa' :
'ssä' );
100 'monday' =>
'maanantai',
101 'tuesday' =>
'tiistai',
102 'wednesday' =>
'keskiviikko',
103 'thursday' =>
'torstai',
104 'friday' =>
'perjantai',
105 'saturday' =>
'lauantai',
106 'sunday' =>
'sunnuntai',
118 'next' =>
'seuraava',
119 'tomorrow' =>
'huomenna',
121 'seconds' =>
'sekuntia',
122 'second' =>
'sekunti',
125 'minutes' =>
'minuuttia',
126 'minute' =>
'minuutti',
133 'weeks' =>
'viikkoa',
135 'fortnights' =>
'tuplaviikkoa',
136 'fortnight' =>
'tuplaviikko',
137 'months' =>
'kuukautta',
138 'month' =>
'kuukausi',
141 'infinite' =>
'ikuinen',
142 'indefinite' =>
'ikuinen',
143 'infinity' =>
'ikuinen'
147 $tokens = explode(
' ', $str );
148 foreach ( $tokens as $item ) {
149 if ( !is_numeric( $item ) ) {
150 if ( count( explode(
'-', $item ) ) == 3 && strlen( $item ) == 10 ) {
151 [ $yyyy, $mm, $dd ] = explode(
'-', $item );
152 $final .=
' ' . $this->
date(
"{$yyyy}{$mm}{$dd}000000" );
155 if ( isset( $weekds[$item] ) ) {
156 $final .=
' ' . $weekds[$item];
161 $final .=
' ' . $item;
164 return trim( $final );
convertGrammar( $word, $case)
Grammatical transformations, needed for inflected languages Invoked by putting {{grammar:case|word}} ...
translateBlockExpiry( $str, UserIdentity $user=null, $now=0)
Base class for language-specific code.
date( $ts, $adj=false, $format=true, $timecorrection=false)
A class containing constants representing the names of configuration variables.