Added result properties to action=paraminfo
[lhc/web/wiklou.git] / languages / classes / LanguageHsb.php
1 <?php
2 /** Upper Sorbian (Hornjoserbsce)
3 *
4 * @ingroup Language
5 */
6
7 class LanguageHsb extends Language {
8
9 /**
10 * Convert from the nominative form of a noun to some other case
11 * Invoked with {{grammar:case|word}}
12 *
13 * @param $word string
14 * @param $case string
15 * @return string
16 */
17 function convertGrammar( $word, $case ) {
18 global $wgGrammarForms;
19 if ( isset( $wgGrammarForms['hsb'][$case][$word] ) ) {
20 return $wgGrammarForms['hsb'][$case][$word];
21 }
22
23 switch ( $case ) {
24 case 'instrumental': # instrumental
25 $word = 'z ' . $word;
26 break;
27 case 'lokatiw': # lokatiw
28 $word = 'wo ' . $word;
29 break;
30 }
31
32 return $word; # this will return the original value for 'nominatiw' (nominativ) and all undefined case values
33 }
34
35 /**
36 * @param $count int
37 * @param $forms array
38 * @return string
39 */
40 function convertPlural( $count, $forms ) {
41 if ( !count( $forms ) ) { return ''; }
42 $forms = $this->preConvertPlural( $forms, 4 );
43
44 switch ( abs( $count ) % 100 ) {
45 case 1: return $forms[0]; // singular
46 case 2: return $forms[1]; // dual
47 case 3:
48 case 4: return $forms[2]; // plural
49 default: return $forms[3]; // pluralgen
50 }
51 }
52 }