42 MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::GrammarForms );
43 if ( isset( $grammarForms[
'fi'][$case][$word] ) ) {
44 return $grammarForms[
'fi'][$case][$word];
47 # These rules don't cover the whole language.
48 # They are used only for site names.
51 $aou = preg_match(
'/[aou][^äöy]*$/i', $word );
53 # The flag should be false for compounds where the last word has only neutral vowels (e/i).
54 # The general case cannot be handled without a dictionary, but there's at least one notable
55 # special case we should check for:
57 if ( preg_match(
'/wiki$/i', $word ) ) {
61 # append i after final consonant
62 if ( preg_match(
'/[bcdfghjklmnpqrstvwxz]$/i', $word ) ) {
71 $word .= ( $aou ?
'sta' :
'stä' );
74 $word .= ( $aou ?
'a' :
'ä' );
77 # Double the last letter and add 'n'
78 $word .= mb_substr( $word, -1 ) .
'n';
81 $word .= ( $aou ?
'ssa' :
'ssä' );
108 'monday' =>
'maanantai',
109 'tuesday' =>
'tiistai',
110 'wednesday' =>
'keskiviikko',
111 'thursday' =>
'torstai',
112 'friday' =>
'perjantai',
113 'saturday' =>
'lauantai',
114 'sunday' =>
'sunnuntai',
126 'next' =>
'seuraava',
127 'tomorrow' =>
'huomenna',
129 'seconds' =>
'sekuntia',
130 'second' =>
'sekunti',
133 'minutes' =>
'minuuttia',
134 'minute' =>
'minuutti',
141 'weeks' =>
'viikkoa',
143 'fortnights' =>
'tuplaviikkoa',
144 'fortnight' =>
'tuplaviikko',
145 'months' =>
'kuukautta',
146 'month' =>
'kuukausi',
149 'infinite' =>
'ikuinen',
150 'indefinite' =>
'ikuinen',
151 'infinity' =>
'ikuinen'
155 $tokens = explode(
' ', $str );
156 foreach ( $tokens as $item ) {
157 if ( !is_numeric( $item ) ) {
158 if ( count( explode(
'-', $item ) ) == 3 && strlen( $item ) == 10 ) {
159 [ $yyyy, $mm, $dd ] = explode(
'-', $item );
160 $final .=
' ' . $this->
date(
"{$yyyy}{$mm}{$dd}000000" );
163 if ( isset( $weekds[$item] ) ) {
164 $final .=
' ' . $weekds[$item];
169 $final .=
' ' . $item;
172 return trim( $final );
convertGrammar( $word, $case)
Convert from the nominative form of a noun to some other case Invoked with {{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.