summaryrefslogtreecommitdiff
path: root/languages/classes/LanguageBs.php
blob: 4734fdc1731d336c916949c8b21ef8a9b7bc7b4f (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
/** Bosnian (bosanski)
  *
  * @package MediaWiki
  * @subpackage Language
  */

class LanguageBs extends Language {

	function convertPlural( $count, $wordform1, $wordform2, $wordform3) {
		$count = str_replace ('.', '', $count);
		if ($count > 10 && floor(($count % 100) / 10) == 1) {
			return $wordform3;
		} else {
			switch ($count % 10) {
				case 1: return $wordform1;
				case 2:
				case 3:
				case 4: return $wordform2;
				default: return $wordform3;
			}
		}
	}

	# Convert from the nominative form of a noun to some other case
	# Invoked with {{GRAMMAR:case|word}}
	/**
	 * Cases: genitiv, dativ, akuzativ, vokativ, instrumental, lokativ
	 */
	function convertGrammar( $word, $case ) {
		global $wgGrammarForms;
		if ( isset($wgGrammarForms['bs'][$case][$word]) ) {
			return $wgGrammarForms['bs'][$case][$word];
		}
		switch ( $case ) {
			case 'genitiv': # genitive
				if ( $word == 'Wikipedia' ) {
					$word = 'Wikipedije';
				} elseif ( $word == 'Wikiknjige' ) {
					$word = 'Wikiknjiga';
				} elseif ( $word == 'Wikivijesti' ) {
					$word = 'Wikivijesti';
				} elseif ( $word == 'Wikicitati' ) {
					$word = 'Wikicitata';
				} elseif ( $word == 'Wikiizvor' ) {
					$word = 'Wikiizvora';
				} elseif ( $word == 'Vikirječnik' ) {
					$word = 'Vikirječnika';
				}
			break;
			case 'dativ': # dative
				if ( $word == 'Wikipedia' ) {
					$word = 'Wikipediji';
				} elseif ( $word == 'Wikiknjige' ) {
					$word = 'Wikiknjigama';
				} elseif ( $word == 'Wikicitati' ) {
					$word = 'Wikicitatima';
				} elseif ( $word == 'Wikivijesti' ) {
					$word = 'Wikivijestima';
				} elseif ( $word == 'Wikiizvor' ) {
					$word = 'Wikiizvoru';
				} elseif ( $word == 'Vikirječnik' ) {
					$word = 'Vikirječniku';
				}
			break;
			case 'akuzativ': # akusative
				if ( $word == 'Wikipedia' ) {
					$word = 'Wikipediju';
				} elseif ( $word == 'Wikiknjige' ) {
					$word = 'Wikiknjige';
				} elseif ( $word == 'Wikicitati' ) {
					$word = 'Wikicitate';
				} elseif ( $word == 'Wikivijesti' ) {
					$word = 'Wikivijesti';
				} elseif ( $word == 'Wikiizvor' ) {
					$word = 'Wikiizvora';
				} elseif ( $word == 'Vikirječnik' ) {
					$word = 'Vikirječnika';
				}
			break;
			case 'vokativ': # vocative
				if ( $word == 'Wikipedia' ) {
					$word = 'Wikipedijo';
				} elseif ( $word == 'Wikiknjige' ) {
					$word = 'Wikiknjige';
				} elseif ( $word == 'Wikicitati' ) {
					$word = 'Wikicitati';
				} elseif ( $word == 'Wikivijesti' ) {
					$word = 'Wikivijesti';
				} elseif ( $word == 'Wikiizvor' ) {
					$word = 'Wikizivoru';
				} elseif ( $word == 'Vikirječnik' ) {
					$word = 'Vikirječniče';
				}
			break;
			case 'instrumental': # instrumental
				if ( $word == 'Wikipedia' ) {
					$word = 's Wikipediom';
				} elseif ( $word == 'Wikiknjige' ) {
					$word = 's Wikiknjigama';
				} elseif ( $word == 'Wikicitati' ) {
					$word = 's Wikicitatima';
				} elseif ( $word == 'Wikivijesti' ) {
					$word = 's Wikivijestima';
				} elseif ( $word == 'Wikiizvor' ) {
					$word = 's Wikiizvorom';
				} elseif ( $word == 'Vikirječnik' ) {
					$word = 's Vikirječnikom';
				} else {
					$word = 's ' . $word;
				}
			break;
			case 'lokativ': # locative
				if ( $word == 'Wikipedia' ) {
					$word = 'o Wikipediji';
				} elseif ( $word == 'Wikiknjige' ) {
					$word = 'o Wikiknjigama';
				} elseif ( $word == 'Wikicitati' ) {
					$word = 'o Wikicitatima';
				} elseif ( $word == 'Wikivijesti' ) {
					$word = 'o Wikivijestima';
				} elseif ( $word == 'Wikiizvor' ) {
					$word = 'o Wikiizvoru';
				} elseif ( $word == 'Vikirječnik' ) {
					$word = 'o Vikirječniku';
				} else {
					$word = 'o ' . $word;
				}
			break;
		}

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

}

?>