35 MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::GrammarForms );
36 if ( isset( $grammarForms[
'fi'][$case][$word] ) ) {
37 return $grammarForms[
'fi'][$case][$word];
40 # These rules don't cover the whole language.
41 # They are used only for site names.
44 $aou = preg_match(
'/[aou][^äöy]*$/i', $word );
46 # The flag should be false for compounds where the last word has only neutral vowels (e/i).
47 # The general case cannot be handled without a dictionary, but there's at least one notable
48 # special case we should check for:
50 if ( preg_match(
'/wiki$/i', $word ) ) {
54 # append i after final consonant
55 if ( preg_match(
'/[bcdfghjklmnpqrstvwxz]$/i', $word ) ) {
64 $word .= ( $aou ?
'sta' :
'stä' );
67 $word .= ( $aou ?
'a' :
'ä' );
70 # Double the last letter and add 'n'
71 $word .= mb_substr( $word, -1 ) .
'n';
74 $word .= ( $aou ?
'ssa' :
'ssä' );
101 'monday' =>
'maanantai',
102 'tuesday' =>
'tiistai',
103 'wednesday' =>
'keskiviikko',
104 'thursday' =>
'torstai',
105 'friday' =>
'perjantai',
106 'saturday' =>
'lauantai',
107 'sunday' =>
'sunnuntai',
119 'next' =>
'seuraava',
120 'tomorrow' =>
'huomenna',
122 'seconds' =>
'sekuntia',
123 'second' =>
'sekunti',
126 'minutes' =>
'minuuttia',
127 'minute' =>
'minuutti',
134 'weeks' =>
'viikkoa',
136 'fortnights' =>
'tuplaviikkoa',
137 'fortnight' =>
'tuplaviikko',
138 'months' =>
'kuukautta',
139 'month' =>
'kuukausi',
142 'infinite' =>
'ikuinen',
143 'indefinite' =>
'ikuinen',
144 'infinity' =>
'ikuinen'
148 $tokens = explode(
' ', $str );
149 foreach ( $tokens as $item ) {
150 if ( !is_numeric( $item ) ) {
151 if ( count( explode(
'-', $item ) ) == 3 && strlen( $item ) == 10 ) {
152 [ $yyyy, $mm, $dd ] = explode(
'-', $item );
153 $final .=
' ' . $this->
date(
"{$yyyy}{$mm}{$dd}000000" );
156 if ( isset( $weekds[$item] ) ) {
157 $final .=
' ' . $weekds[$item];
162 $final .=
' ' . $item;
165 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.