summaryrefslogtreecommitdiff
path: root/languages/classes/LanguageCs.php
blob: 4a52368e7394ec7b92c4d892ee13c4e863697546 (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
<?php
/** Czech (česky)
 *
 * @addtogroup Language
 */

#--------------------------------------------------------------------------
# Internationalisation code
#--------------------------------------------------------------------------

class LanguageCs extends Language {
	# Grammatical transformations, needed for inflected languages
	# Invoked by putting {{grammar:case|word}} in a message
	function convertGrammar( $word, $case ) {
		global $wgGrammarForms;
		if ( isset($wgGrammarForms['cs'][$case][$word]) ) {
			return $wgGrammarForms['cs'][$case][$word];
		}
		# allowed values for $case:
		#	1sg, 2sg, ..., 7sg -- nominative, genitive, ... (in singular)
		switch ( $word ) {
			case 'Wikibooks':
			case 'Wikiknihy':
				switch ( $case ) {
					case '2sg':
						return 'Wikiknih';
					case '3sg':
						return 'Wikiknihám';
					case '6sg';
						return 'Wikiknihách';
					case '7sg':
						return 'Wikiknihami';
					default:
						return 'Wikiknihy';
				}
			case 'Wikipedia':
			case 'Wikipedie':
				switch ( $case ) {
					case '3sg':
					case '4sg':
					case '6sg':
						return 'Wikipedii';
					case '7sg':
						return 'Wikipedií';
					default:
						return 'Wikipedie';
				}

			case 'Wiktionary':
			case 'Wikcionář':
			case 'Wikislovník':
				switch ( $case ) {
					case '2sg':
					case '3sg':
					case '5sg';
					case '6sg';
						return 'Wikislovníku';
					case '7sg':
						return 'Wikislovníkem';
					default:
						return 'Wikislovník';
				}

			case 'Wikiquote':
			case 'Wikicitáty':
				switch ( $case ) {
					case '2sg':
						return 'Wikicitátů';
					case '3sg':
						return 'Wikicitátům';
					case '6sg';
						return 'Wikicitátech';
					default:
						return 'Wikicitáty';
				}
		}
		# unknown
		return $word;
	}

	function convertPlural( $count, $forms ) {
		if ( !count($forms) ) { return ''; }
		$forms = $this->preConvertPlural( $forms, 3 );

		switch ( $count ) {
			case 1:  return $forms[0];
			case 2:
			case 3:
			case 4:  return $forms[1];
			default: return $forms[2];
		}
	}

}