fixing encoding problems on r36664
[lhc/web/wiklou.git] / languages / classes / LanguageRmy.php
1 <?php
2
3 /**
4 * @ingroup Language
5 */
6 class LanguageRmy extends Language {
7 /**
8 * Convert from the nominative form of a noun to some other case
9 * Invoked with {{GRAMMAR:case|word}}
10 *
11 * Cases: nominative, genitive-m-sg, genitive-f-sg, dative, locative, ablative, instrumental
12 */
13 public function convertGrammar( $word, $case ) {
14 global $wgGrammarForms;
15 if ( isset($wgGrammarForms['rmy'][$case][$word]) ) {
16 return $wgGrammarForms['rmy'][$case][$word];
17 }
18
19 switch ( $case ) {
20 case 'genitive-m-sg': # genitive (m.sg.)
21 if ( $word == 'Vikipidiya' ) {
22 $word = 'Vikipidiyako';
23 } elseif ( $word == 'Vikcyonaro' ) {
24 $word = 'Vikcyonaresko';
25 }
26 break;
27 case 'genitive-f-sg': # genitive (f.sg.)
28 if ( $word == 'Vikipidiya' ) {
29 $word = 'Vikipidiyaki';
30 } elseif ( $word == 'Vikcyonaro' ) {
31 $word = 'Vikcyonareski';
32 }
33 break;
34 case 'genitive-pl': # genitive (pl.)
35 if ( $word == 'Vikipidiya' ) {
36 $word = 'Vikipidiyake';
37 } elseif ( $word == 'Vikcyonaro' ) {
38 $word = 'Vikcyonareske';
39 }
40 break;
41 case 'dativ':
42 if ( $word == 'Vikipidiyake' ) {
43 $word = 'Wikipediji';
44 } elseif ( $word == 'Vikcyonaro' ) {
45 $word = 'Vikcyonareske';
46 }
47 break;
48 case 'locative':
49 if ( $word == 'Vikipidiyate' ) {
50 $word = 'Wikipedijo';
51 } elseif ( $word == 'Vikcyonaro' ) {
52 $word = 'Vikcyonareste';
53 }
54 break;
55 case 'ablative':
56 if ( $word == 'Vikipidiyatar' ) {
57 $word = 'o Wikipediji';
58 } elseif ( $word == 'Vikcyonaro' ) {
59 $word = 'Vikcyonarestar';
60 }
61 break;
62 case 'instrumental':
63 if ( $word == 'Vikipidiyasa' ) {
64 $word = 'z Wikipedijo';
65 } elseif ( $word == 'Vikcyonaro' ) {
66 $word = 'Vikcyonaresa';
67 }
68 break;
69 }
70
71 return $word; # this will return the original value for 'nominative' and all undefined case values
72 }
73 }