2004-02-18 02:15:00 +00:00
|
|
|
<?php
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
|
2005-04-09 15:16:34 +00:00
|
|
|
/** Finnish (Suomi)
|
|
|
|
|
*
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @ingroup Language
|
2006-06-11 21:45:19 +00:00
|
|
|
*
|
|
|
|
|
* @author Niklas Laxström
|
2005-04-09 15:16:34 +00:00
|
|
|
*/
|
2006-07-26 07:15:39 +00:00
|
|
|
class LanguageFi extends Language {
|
2005-08-15 19:27:58 +00:00
|
|
|
|
|
|
|
|
# Convert from the nominative form of a noun to some other case
|
|
|
|
|
# Invoked with {{GRAMMAR:case|word}}
|
|
|
|
|
function convertGrammar( $word, $case ) {
|
2006-05-25 14:31:28 +00:00
|
|
|
global $wgGrammarForms;
|
2010-07-29 09:43:18 +00:00
|
|
|
if ( isset( $wgGrammarForms['fi'][$case][$word] ) ) {
|
2006-05-25 20:52:45 +00:00
|
|
|
return $wgGrammarForms['fi'][$case][$word];
|
2006-05-25 14:31:28 +00:00
|
|
|
}
|
|
|
|
|
|
2005-08-15 19:27:58 +00:00
|
|
|
# These rules are not perfect, but they are currently only used for site names so it doesn't
|
|
|
|
|
# matter if they are wrong sometimes. Just add a special case for your site name if necessary.
|
2006-12-17 23:44:40 +00:00
|
|
|
|
|
|
|
|
# wovel harmony flag
|
|
|
|
|
$aou = preg_match( '/[aou][^äöy]*$/i', $word );
|
|
|
|
|
|
2007-02-10 22:03:31 +00:00
|
|
|
# The flag should be false for compounds where the last word has only neutral vowels (e/i).
|
|
|
|
|
# The general case cannot be handled without a dictionary, but there's at least one notable
|
|
|
|
|
# special case we should check for:
|
|
|
|
|
|
|
|
|
|
if ( preg_match( '/wiki$/i', $word ) )
|
|
|
|
|
$aou = false;
|
|
|
|
|
|
2006-12-17 23:44:40 +00:00
|
|
|
# append i after final consonant
|
|
|
|
|
if ( preg_match( '/[bcdfghjklmnpqrstvwxz]$/i', $word ) )
|
|
|
|
|
$word .= 'i';
|
|
|
|
|
|
2005-08-15 19:27:58 +00:00
|
|
|
switch ( $case ) {
|
|
|
|
|
case 'genitive':
|
2006-12-17 23:44:40 +00:00
|
|
|
$word .= 'n';
|
|
|
|
|
break;
|
2005-08-15 19:27:58 +00:00
|
|
|
case 'elative':
|
2010-07-29 09:43:18 +00:00
|
|
|
$word .= ( $aou ? 'sta' : 'stä' );
|
2005-08-15 19:27:58 +00:00
|
|
|
break;
|
|
|
|
|
case 'partitive':
|
2010-07-29 09:43:18 +00:00
|
|
|
$word .= ( $aou ? 'a' : 'ä' );
|
2005-08-15 19:27:58 +00:00
|
|
|
break;
|
|
|
|
|
case 'illative':
|
|
|
|
|
# Double the last letter and add 'n'
|
|
|
|
|
# mb_substr has a compatibility function in GlobalFunctions.php
|
2010-07-29 09:43:18 +00:00
|
|
|
$word = $word . mb_substr( $word, -1 ) . 'n';
|
2005-08-15 19:27:58 +00:00
|
|
|
break;
|
|
|
|
|
case 'inessive':
|
2010-07-29 09:43:18 +00:00
|
|
|
$word .= ( $aou ? 'ssa' : 'ssä' );
|
2005-08-15 19:27:58 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return $word;
|
|
|
|
|
}
|
2005-08-12 17:18:53 +00:00
|
|
|
|
2007-05-22 15:11:17 +00:00
|
|
|
function translateBlockExpiry( $str, $forContent = false ) {
|
2005-09-09 17:46:21 +00:00
|
|
|
/*
|
|
|
|
|
'ago', 'now', 'today', 'this', 'next',
|
|
|
|
|
'first', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'eighth', 'ninth', 'tenth', 'eleventh', 'twelfth',
|
|
|
|
|
'tomorrow', 'yesterday'
|
|
|
|
|
|
|
|
|
|
$months = 'january:tammikuu,february:helmikuu,march:maaliskuu,april:huhtikuu,may:toukokuu,june:kesäkuu,' .
|
|
|
|
|
'july:heinäkuu,august:elokuu,september:syyskuu,october:lokakuu,november:marraskuu,december:joulukuu,' .
|
|
|
|
|
'jan:tammikuu,feb:helmikuu,mar:maaliskuu,apr:huhtikuu,jun:kesäkuu,jul:heinäkuu,aug:elokuu,sep:syyskuu,'.
|
|
|
|
|
'oct:lokakuu,nov:marraskuu,dec:joulukuu,sept:syyskuu';
|
2005-08-27 16:35:10 +00:00
|
|
|
*/
|
2005-09-09 17:46:21 +00:00
|
|
|
$weekds = array(
|
|
|
|
|
'monday' => 'maanantai',
|
|
|
|
|
'tuesday' => 'tiistai',
|
|
|
|
|
'wednesday' => 'keskiviikko',
|
|
|
|
|
'thursay' => 'torstai',
|
|
|
|
|
'friday' => 'perjantai',
|
|
|
|
|
'saturday' => 'lauantai',
|
|
|
|
|
'sunday' => 'sunnuntai',
|
|
|
|
|
'mon' => 'ma',
|
|
|
|
|
'tue' => 'ti',
|
|
|
|
|
'tues' => 'ti',
|
|
|
|
|
'wed' => 'ke',
|
|
|
|
|
'wednes' => 'ke',
|
|
|
|
|
'thu' => 'to',
|
|
|
|
|
'thur' => 'to',
|
|
|
|
|
'thurs' => 'to',
|
|
|
|
|
'fri' => 'pe',
|
|
|
|
|
'sat' => 'la',
|
|
|
|
|
'sun' => 'su',
|
|
|
|
|
'next' => 'seuraava',
|
|
|
|
|
'tomorrow' => 'huomenna',
|
|
|
|
|
'ago' => 'sitten',
|
|
|
|
|
'seconds' => 'sekuntia',
|
|
|
|
|
'second' => 'sekunti',
|
|
|
|
|
'secs' => 's',
|
|
|
|
|
'sec' => 's',
|
|
|
|
|
'minutes' => 'minuuttia',
|
|
|
|
|
'minute' => 'minuutti',
|
|
|
|
|
'mins' => 'min',
|
|
|
|
|
'min' => 'min',
|
|
|
|
|
'days' => 'päivää',
|
|
|
|
|
'day' => 'päivä',
|
|
|
|
|
'hours' => 'tuntia',
|
|
|
|
|
'hour' => 'tunti',
|
|
|
|
|
'weeks' => 'viikkoa',
|
|
|
|
|
'week' => 'viikko',
|
|
|
|
|
'fortnights' => 'tuplaviikkoa',
|
|
|
|
|
'fortnight' => 'tuplaviikko',
|
|
|
|
|
'months' => 'kuukautta',
|
|
|
|
|
'month' => 'kuukausi',
|
|
|
|
|
'years' => 'vuotta',
|
|
|
|
|
'year' => 'vuosi',
|
|
|
|
|
'infinite' => 'ikuisesti',
|
|
|
|
|
'indefinite' => 'ikuisesti'
|
|
|
|
|
);
|
|
|
|
|
|
2005-08-27 16:35:10 +00:00
|
|
|
$final = '';
|
2010-07-29 09:43:18 +00:00
|
|
|
$tokens = explode ( ' ', $str );
|
|
|
|
|
foreach ( $tokens as $item ) {
|
|
|
|
|
if ( !is_numeric( $item ) ) {
|
|
|
|
|
if ( count ( explode( '-', $item ) ) == 3 && strlen( $item ) == 10 ) {
|
2005-08-27 16:35:10 +00:00
|
|
|
list( $yyyy, $mm, $dd ) = explode( '-', $item );
|
2011-02-26 08:19:21 +00:00
|
|
|
$final .= ' ' . $this->date( "{$yyyy}{$mm}{$dd}000000" );
|
2005-08-27 16:35:10 +00:00
|
|
|
continue;
|
|
|
|
|
}
|
2010-07-29 09:43:18 +00:00
|
|
|
if ( isset( $weekds[$item] ) ) {
|
2005-09-09 17:46:21 +00:00
|
|
|
$final .= ' ' . $weekds[$item];
|
|
|
|
|
continue;
|
2005-08-27 16:35:10 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-09-09 17:46:21 +00:00
|
|
|
$final .= ' ' . $item;
|
2005-08-27 16:35:10 +00:00
|
|
|
}
|
2007-05-22 15:11:17 +00:00
|
|
|
|
2007-09-10 01:53:24 +00:00
|
|
|
return htmlspecialchars( trim( $final ) );
|
2005-08-27 16:35:10 +00:00
|
|
|
}
|
2003-11-28 10:00:23 +00:00
|
|
|
}
|