wiki.techinc.nl/languages/classes/LanguageHsb.php

53 lines
1.2 KiB
PHP
Raw Normal View History

2006-10-12 22:53:41 +00:00
<?php
/** Upper Sorbian (Hornjoserbsce)
*
* @ingroup Language
2006-10-12 22:53:41 +00:00
*/
class LanguageHsb extends Language {
2011-05-29 16:32:05 +00:00
/**
* Convert from the nominative form of a noun to some other case
* Invoked with {{grammar:case|word}}
*
* @param $word string
* @param $case string
* @return string
*/
2006-10-12 22:53:41 +00:00
function convertGrammar( $word, $case ) {
global $wgGrammarForms;
if ( isset( $wgGrammarForms['hsb'][$case][$word] ) ) {
return $wgGrammarForms['hsb'][$case][$word];
}
switch ( $case ) {
case 'instrumental': # instrumental
$word = 'z ' . $word;
2006-10-12 22:53:41 +00:00
break;
case 'lokatiw': # lokatiw
$word = 'wo ' . $word;
2006-10-12 22:53:41 +00:00
break;
}
2006-10-12 22:53:41 +00:00
return $word; # this will return the original value for 'nominatiw' (nominativ) and all undefined case values
}
2011-05-29 15:20:43 +00:00
/**
* @param $count int
* @param $forms array
* @return string
*/
function convertPlural( $count, $forms ) {
if ( !count( $forms ) ) { return ''; }
$forms = $this->preConvertPlural( $forms, 4 );
switch ( abs( $count ) % 100 ) {
case 1: return $forms[0]; // singular
case 2: return $forms[1]; // dual
case 3:
case 4: return $forms[2]; // plural
default: return $forms[3]; // pluralgen
}
}
2006-10-12 22:53:41 +00:00
}