MediaWiki  1.23.15
LanguageFi.php
Go to the documentation of this file.
1 <?php
30 class LanguageFi extends Language {
31 
40  function convertGrammar( $word, $case ) {
41  global $wgGrammarForms;
42  if ( isset( $wgGrammarForms['fi'][$case][$word] ) ) {
43  return $wgGrammarForms['fi'][$case][$word];
44  }
45 
46  # These rules are not perfect, but they are currently only used for site names so it doesn't
47  # matter if they are wrong sometimes. Just add a special case for your site name if necessary.
48 
49  # wovel harmony flag
50  $aou = preg_match( '/[aou][^äöy]*$/i', $word );
51 
52  # The flag should be false for compounds where the last word has only neutral vowels (e/i).
53  # The general case cannot be handled without a dictionary, but there's at least one notable
54  # special case we should check for:
55 
56  if ( preg_match( '/wiki$/i', $word ) ) {
57  $aou = false;
58  }
59 
60  # append i after final consonant
61  if ( preg_match( '/[bcdfghjklmnpqrstvwxz]$/i', $word ) ) {
62  $word .= 'i';
63  }
64 
65  switch ( $case ) {
66  case 'genitive':
67  $word .= 'n';
68  break;
69  case 'elative':
70  $word .= ( $aou ? 'sta' : 'stä' );
71  break;
72  case 'partitive':
73  $word .= ( $aou ? 'a' : 'ä' );
74  break;
75  case 'illative':
76  # Double the last letter and add 'n'
77  # mb_substr has a compatibility function in GlobalFunctions.php
78  $word = $word . mb_substr( $word, -1 ) . 'n';
79  break;
80  case 'inessive':
81  $word .= ( $aou ? 'ssa' : 'ssä' );
82  break;
83  }
84  return $word;
85  }
86 
92  function translateBlockExpiry( $str, $forContent = false ) {
93  /*
94  'ago', 'now', 'today', 'this', 'next',
95  'first', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'eighth', 'ninth', 'tenth', 'eleventh', 'twelfth',
96  'tomorrow', 'yesterday'
97 
98  $months = 'january:tammikuu,february:helmikuu,march:maaliskuu,april:huhtikuu,may:toukokuu,june:kesäkuu,' .
99  'july:heinäkuu,august:elokuu,september:syyskuu,october:lokakuu,november:marraskuu,december:joulukuu,' .
100  'jan:tammikuu,feb:helmikuu,mar:maaliskuu,apr:huhtikuu,jun:kesäkuu,jul:heinäkuu,aug:elokuu,sep:syyskuu,'.
101  'oct:lokakuu,nov:marraskuu,dec:joulukuu,sept:syyskuu';
102  */
103  $weekds = array(
104  'monday' => 'maanantai',
105  'tuesday' => 'tiistai',
106  'wednesday' => 'keskiviikko',
107  'thursday' => 'torstai',
108  'friday' => 'perjantai',
109  'saturday' => 'lauantai',
110  'sunday' => 'sunnuntai',
111  'mon' => 'ma',
112  'tue' => 'ti',
113  'tues' => 'ti',
114  'wed' => 'ke',
115  'wednes' => 'ke',
116  'thu' => 'to',
117  'thur' => 'to',
118  'thurs' => 'to',
119  'fri' => 'pe',
120  'sat' => 'la',
121  'sun' => 'su',
122  'next' => 'seuraava',
123  'tomorrow' => 'huomenna',
124  'ago' => 'sitten',
125  'seconds' => 'sekuntia',
126  'second' => 'sekunti',
127  'secs' => 's',
128  'sec' => 's',
129  'minutes' => 'minuuttia',
130  'minute' => 'minuutti',
131  'mins' => 'min',
132  'min' => 'min',
133  'days' => 'päivää',
134  'day' => 'päivä',
135  'hours' => 'tuntia',
136  'hour' => 'tunti',
137  'weeks' => 'viikkoa',
138  'week' => 'viikko',
139  'fortnights' => 'tuplaviikkoa',
140  'fortnight' => 'tuplaviikko',
141  'months' => 'kuukautta',
142  'month' => 'kuukausi',
143  'years' => 'vuotta',
144  'year' => 'vuosi',
145  'infinite' => 'ikuisesti',
146  'indefinite' => 'ikuisesti'
147  );
148 
149  $final = '';
150  $tokens = explode ( ' ', $str );
151  foreach ( $tokens as $item ) {
152  if ( !is_numeric( $item ) ) {
153  if ( count ( explode( '-', $item ) ) == 3 && strlen( $item ) == 10 ) {
154  list( $yyyy, $mm, $dd ) = explode( '-', $item );
155  $final .= ' ' . $this->date( "{$yyyy}{$mm}{$dd}000000" );
156  continue;
157  }
158  if ( isset( $weekds[$item] ) ) {
159  $final .= ' ' . $weekds[$item];
160  continue;
161  }
162  }
163 
164  $final .= ' ' . $item;
165  }
166 
167  return htmlspecialchars( trim( $final ) );
168  }
169 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
LanguageFi\convertGrammar
convertGrammar( $word, $case)
Convert from the nominative form of a noun to some other case Invoked with {{grammar:case|word}}.
Definition: LanguageFi.php:40
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
LanguageFi\translateBlockExpiry
translateBlockExpiry( $str, $forContent=false)
Definition: LanguageFi.php:92
list
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
Definition: deferred.txt:11
Language\date
date( $ts, $adj=false, $format=true, $timecorrection=false)
Definition: Language.php:2050
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
LanguageFi
Finnish (Suomi)
Definition: LanguageFi.php:30
Language
Internationalisation code.
Definition: Language.php:74