]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blob - languages/classes/LanguageCs.php
MediaWiki 1.11.0
[autoinstallsdev/mediawiki.git] / languages / classes / LanguageCs.php
1 <?php
2 /** Czech (česky)
3  *
4  * @addtogroup Language
5  */
6
7 #--------------------------------------------------------------------------
8 # Internationalisation code
9 #--------------------------------------------------------------------------
10
11 class LanguageCs extends Language {
12         # Grammatical transformations, needed for inflected languages
13         # Invoked by putting {{grammar:case|word}} in a message
14         function convertGrammar( $word, $case ) {
15                 global $wgGrammarForms;
16                 if ( isset($wgGrammarForms['cs'][$case][$word]) ) {
17                         return $wgGrammarForms['cs'][$case][$word];
18                 }
19                 # allowed values for $case:
20                 #       1sg, 2sg, ..., 7sg -- nominative, genitive, ... (in singular)
21                 switch ( $word ) {
22                         case 'Wikipedia':
23                         case 'Wikipedie':
24                                 switch ( $case ) {
25                                         case '3sg':
26                                         case '4sg':
27                                         case '6sg':
28                                                 return 'Wikipedii';
29                                         case '7sg':
30                                                 return 'Wikipedií';
31                                         default:
32                                                 return 'Wikipedie';
33                                 }
34
35                         case 'Wiktionary':
36                         case 'Wikcionář':
37                                 switch ( $case ) {
38                                         case '2sg':
39                                                 return 'Wikcionáře';
40                                         case '3sg':
41                                         case '5sg';
42                                         case '6sg';
43                                                 return 'Wikcionáři';
44                                         case '7sg':
45                                                 return 'Wikcionářem';
46                                         default:
47                                                 return 'Wikcionář';
48                                 }
49
50                         case 'Wikiquote':
51                         case 'Wikicitáty':
52                                 switch ( $case ) {
53                                         case '2sg':
54                                                 return 'Wikicitátů';
55                                         case '3sg':
56                                                 return 'Wikicitátům';
57                                         case '6sg';
58                                                 return 'Wikicitátech';
59                                         default:
60                                                 return 'Wikicitáty';
61                                 }
62                 }
63                 # unknown
64                 return $word;
65         }
66
67   # Plural form transformations, needed for some languages.
68   # Invoked by {{plural:count|wordform1|wordform2|wordform3}}
69   function convertPlural( $count, $wordform1, $wordform2, $wordform3, $w4, $w5) {
70     $count = str_replace( '\xc2\xa0', '', $count );
71     switch ( $count ) {
72       case 1:
73         return $wordform1;
74
75       case 2:
76       case 3:
77       case 4:
78         return $wordform2;
79
80       default:
81         return $wordform3;
82     };
83   }
84 }
85
86