22 MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::GrammarForms );
23 if ( isset( $grammarForms[
'fi'][$case][$word] ) ) {
24 return $grammarForms[
'fi'][$case][$word];
27 # These rules don't cover the whole language.
28 # They are used only for site names.
31 $aou = preg_match(
'/[aou][^äöy]*$/i', $word );
33 # The flag should be false for compounds where the last word has only neutral vowels (e/i).
34 # The general case cannot be handled without a dictionary, but there's at least one notable
35 # special case we should check for:
37 if ( preg_match(
'/wiki$/i', $word ) ) {
41 # append i after final consonant
42 if ( preg_match(
'/[bcdfghjklmnpqrstvwxz]$/i', $word ) ) {
51 $word .= ( $aou ?
'sta' :
'stä' );
54 $word .= ( $aou ?
'a' :
'ä' );
57 # Double the last letter and add 'n'
58 $word .= mb_substr( $word, -1 ) .
'n';
61 $word .= ( $aou ?
'ssa' :
'ssä' );
88 'monday' =>
'maanantai',
89 'tuesday' =>
'tiistai',
90 'wednesday' =>
'keskiviikko',
91 'thursday' =>
'torstai',
92 'friday' =>
'perjantai',
93 'saturday' =>
'lauantai',
94 'sunday' =>
'sunnuntai',
106 'next' =>
'seuraava',
107 'tomorrow' =>
'huomenna',
109 'seconds' =>
'sekuntia',
110 'second' =>
'sekunti',
113 'minutes' =>
'minuuttia',
114 'minute' =>
'minuutti',
121 'weeks' =>
'viikkoa',
123 'fortnights' =>
'tuplaviikkoa',
124 'fortnight' =>
'tuplaviikko',
125 'months' =>
'kuukautta',
126 'month' =>
'kuukausi',
129 'infinite' =>
'ikuinen',
130 'indefinite' =>
'ikuinen',
131 'infinity' =>
'ikuinen'
135 $tokens = explode(
' ', $str );
136 foreach ( $tokens as $item ) {
137 if ( !is_numeric( $item ) ) {
138 if ( count( explode(
'-', $item ) ) == 3 && strlen( $item ) == 10 ) {
139 [ $yyyy, $mm, $dd ] = explode(
'-', $item );
140 $final .=
' ' . $this->
date(
"{$yyyy}{$mm}{$dd}000000" );
143 if ( isset( $weekds[$item] ) ) {
144 $final .=
' ' . $weekds[$item];
149 $final .=
' ' . $item;
152 return trim( $final );
translateBlockExpiry( $str, ?UserIdentity $user=null, $now=0)
convertGrammar( $word, $case)
Grammatical transformations, needed for inflected languages Invoked by putting {{grammar:case|word}} ...
A class containing constants representing the names of configuration variables.