Stylize languages/*, languages/classes/*, but not languages/messages/*
[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 # Convert from the nominative form of a noun to some other case
10 # Invoked with {{GRAMMAR:case|word}}
11
12 function convertGrammar( $word, $case ) {
13 global $wgGrammarForms;
14 if ( isset( $wgGrammarForms['hsb'][$case][$word] ) ) {
15 return $wgGrammarForms['hsb'][$case][$word];
16 }
17
18 switch ( $case ) {
19 case 'instrumental': # instrumental
20 $word = 'z ' . $word;
21 break;
22 case 'lokatiw': # lokatiw
23 $word = 'wo ' . $word;
24 break;
25 }
26
27 return $word; # this will return the original value for 'nominatiw' (nominativ) and all undefined case values
28 }
29
30 function convertPlural( $count, $forms ) {
31 if ( !count( $forms ) ) { return ''; }
32 $forms = $this->preConvertPlural( $forms, 4 );
33
34 switch ( abs( $count ) % 100 ) {
35 case 1: return $forms[0]; // singular
36 case 2: return $forms[1]; // dual
37 case 3:
38 case 4: return $forms[2]; // plural
39 default: return $forms[3]; // pluralgen
40 }
41 }
42 }