summaryrefslogtreecommitdiff
path: root/languages/classes/LanguageRmy.php
blob: bbf22d52e4de48f05a267372ebe4f319c77a3b16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php

class LanguageRmy extends Language {
	/**
	 * Convert from the nominative form of a noun to some other case
	 * Invoked with {{GRAMMAR:case|word}}
	 *
	 * Cases: nominative, genitive-m-sg, genitive-f-sg, dative, locative, ablative, instrumental
	 */
	public function convertGrammar( $word, $case ) {
		global $wgGrammarForms;
		if ( isset($wgGrammarForms['rmy'][$case][$word]) ) {
			return $wgGrammarForms['rmy'][$case][$word];
		}

		switch ( $case ) {
			case 'genitive-m-sg': # genitive (m.sg.)
				if ( $word == 'Vikipidiya' ) {
					$word = 'Vikipidiyako';
				} elseif ( $word == 'Vikcyonaro' ) {
					$word = 'Vikcyonaresko';
				}
			break;
			case 'genitive-f-sg': # genitive (f.sg.)
				if ( $word == 'Vikipidiya' ) {
					$word = 'Vikipidiyaki';
				} elseif ( $word == 'Vikcyonaro' ) {
					$word = 'Vikcyonareski';
				}
			break;
			case 'genitive-pl': # genitive (pl.)
				if ( $word == 'Vikipidiya' ) {
					$word = 'Vikipidiyake';
				} elseif ( $word == 'Vikcyonaro' ) {
					$word = 'Vikcyonareske';
				}
			break;
			case 'dativ':
				if ( $word == 'Vikipidiyake' ) {
					$word = 'Wikipediji';
				} elseif ( $word == 'Vikcyonaro' ) {
					$word = 'Vikcyonareske';
				}
			break;
			case 'locative':
				if ( $word == 'Vikipidiyate' ) {
					$word = 'Wikipedijo';
				} elseif ( $word == 'Vikcyonaro' ) {
					$word = 'Vikcyonareste';
				}
			break;
			case 'ablative':
				if ( $word == 'Vikipidiyatar' ) {
					$word = 'o Wikipediji';
				} elseif ( $word == 'Vikcyonaro' ) {
					$word = 'Vikcyonarestar';
				}
			break;
			case 'instrumental':
				if ( $word == 'Vikipidiyasa' ) {
					$word = 'z Wikipedijo';
				} elseif ( $word == 'Vikcyonaro' ) {
					$word = 'Vikcyonaresa';
				}
			break;
		}

		return $word; # this will return the original value for 'nominative' and all undefined case values
	}
}

?>