7768a8aeb759ff72e5800f2848816689eb9e5b2e
[lhc/web/wiklou.git] / languages / LanguageCs.php
1 <?php
2 /** Czech (česky)
3 *
4 * @package MediaWiki
5 * @subpackage Language
6 */
7
8 /** */
9 require_once( 'LanguageUtf8.php' );
10
11 # Yucky hardcoding hack
12 switch( $wgMetaNamespace ) {
13 case 'Wikipedie':
14 case 'Wikipedia':
15 $wgUserNamespace = 'Wikipedista'; break;
16 default:
17 $wgUserNamespace = 'Uživatel';
18 }
19
20 /* private */ $wgNamespaceNamesCs = array(
21 NS_MEDIA => 'Média',
22 NS_SPECIAL => 'Speciální',
23 NS_MAIN => '',
24 NS_TALK => 'Diskuse',
25 NS_USER => $wgUserNamespace,
26 NS_USER_TALK => $wgUserNamespace . '_diskuse',
27 NS_PROJECT => $wgMetaNamespace,
28 NS_PROJECT_TALK => $wgMetaNamespace . '_diskuse',
29 NS_IMAGE => 'Soubor',
30 NS_IMAGE_TALK => 'Soubor_diskuse',
31 NS_MEDIAWIKI => 'MediaWiki',
32 NS_MEDIAWIKI_TALK => 'MediaWiki_diskuse',
33 NS_TEMPLATE => 'Šablona',
34 NS_TEMPLATE_TALK => 'Šablona_diskuse',
35 NS_HELP => 'Nápověda',
36 NS_HELP_TALK => 'Nápověda_diskuse',
37 NS_CATEGORY => 'Kategorie',
38 NS_CATEGORY_TALK => 'Kategorie_diskuse',
39 ) + $wgNamespaceNamesEn;
40
41 /* private */ $wgQuickbarSettingsCs = array(
42 'Žádný', 'Leží vlevo', 'Leží vpravo', 'Visí vlevo'
43 );
44
45 /* private */ $wgSkinNamesCs = array(
46 'standard' => 'Standard',
47 'nostalgia' => 'Nostalgie',
48 'cologneblue' => 'Kolínská modř',
49 'chick' => 'Kuře'
50 ) + $wgSkinNamesEn;
51
52 # Hledání knihy podle ISBN
53 # $wgBookstoreListCs = ..
54 /* private */ $wgBookstoreListCs = array(
55 'Národní knihovna' => 'http://sigma.nkp.cz/F/?func=find-a&find_code=ISN&request=$1',
56 'Státní technická knihovna' => 'http://www.stk.cz/cgi-bin/dflex/CZE/STK/BROWSE?A=01&V=$1'
57 ) + $wgBookstoreListEn;
58
59 # Note to translators:
60 # Please include the English words as synonyms. This allows people
61 # from other wikis to contribute more easily.
62 #
63 # Nepoužívá se, pro používání je třeba povolit getMagicWords dole v LanguageCs.
64 /* private */ $wgMagicWordsCs = array(
65 ## ID CASE SYNONYMS
66 MAG_REDIRECT => array( 0, '#REDIRECT', '#PŘESMĚRUJ' ),
67 MAG_NOTOC => array( 0, '__NOTOC__', '__BEZOBSAHU__' ),
68 MAG_FORCETOC => array( 0, '__FORCETOC__', '__VŽDYOBSAH__' ),
69 MAG_TOC => array( 0, '__TOC__', '__OBSAH__' ),
70 MAG_NOEDITSECTION => array( 0, '__NOEDITSECTION__', '__BEZEDITOVATČÁST__' ),
71 MAG_START => array( 0, '__START__', '__ZAČÁTEK__' ),
72 MAG_CURRENTMONTH => array( 1, 'CURRENTMONTH', 'AKTUÁLNÍMĚSÍC' ),
73 MAG_CURRENTMONTHNAME => array( 1, 'CURRENTMONTHNAME', 'AKTUÁLNÍMĚSÍCJMÉNO' ),
74 MAG_CURRENTMONTHNAMEGEN => array( 1, 'CURRENTMONTHNAMEGEN', 'AKTUÁLNÍMĚSÍCGEN' ),
75 # MAG_CURRENTMONTHABBREV => array( 1, 'CURRENTMONTHABBREV' 'AKTUÁLNÍMĚSÍCZKR' ),
76 MAG_CURRENTDAY => array( 1, 'CURRENTDAY', 'AKTUÁLNÍDEN' ),
77 MAG_CURRENTDAYNAME => array( 1, 'CURRENTDAYNAME', 'AKTUÁLNÍDENJMÉNO' ),
78 MAG_CURRENTYEAR => array( 1, 'CURRENTYEAR', 'AKTUÁLNÍROK' ),
79 MAG_CURRENTTIME => array( 1, 'CURRENTTIME', 'AKTUÁLNÍČAS' ),
80 MAG_NUMBEROFARTICLES => array( 1, 'NUMBEROFARTICLES', 'POČETČLÁNKŮ' ),
81 MAG_PAGENAME => array( 1, 'PAGENAME', 'NÁZEVSTRANY' ),
82 MAG_PAGENAMEE => array( 1, 'PAGENAMEE', 'NÁZEVSTRANYE' ),
83 MAG_NAMESPACE => array( 1, 'NAMESPACE', 'JMENNÝPROSTOR' ),
84 MAG_MSG => array( 0, 'MSG:' ),
85 MAG_SUBST => array( 0, 'SUBST:', 'VLOŽIT:' ),
86 MAG_MSGNW => array( 0, 'MSGNW:', 'VLOŽITNW:' ),
87 MAG_END => array( 0, '__END__', '__KONEC__' ),
88 MAG_IMG_THUMBNAIL => array( 1, 'thumbnail', 'thumb', 'náhled' ),
89 MAG_IMG_RIGHT => array( 1, 'right', 'vpravo' ),
90 MAG_IMG_LEFT => array( 1, 'left', 'vlevo' ),
91 MAG_IMG_NONE => array( 1, 'none', 'žádné' ),
92 MAG_IMG_WIDTH => array( 1, '$1px' ),
93 MAG_IMG_CENTER => array( 1, 'center', 'centre', 'střed' ),
94 MAG_IMG_FRAMED => array( 1, 'framed', 'enframed', 'frame', 'rám' ),
95 MAG_INT => array( 0, 'INT:' ),
96 MAG_SITENAME => array( 1, 'SITENAME', 'NÁZEVSERVERU' ),
97 MAG_NS => array( 0, 'NS:' ),
98 MAG_LOCALURL => array( 0, 'LOCALURL:', 'MÍSTNÍURL:' ),
99 MAG_LOCALURLE => array( 0, 'LOCALURLE:', 'MÍSTNÍURLE:' ),
100 MAG_SERVER => array( 0, 'SERVER' ),
101 MAG_REVISIONID => array( 1, 'REVISIONID', 'IDREVIZE' )
102 );
103 wfRunHooks( 'AddMagicWordsCs', array( &$wgMagicWordsCs ) );
104
105 if (!$wgCachedMessageArrays) {
106 require_once('MessagesCs.php');
107 }
108
109 #--------------------------------------------------------------------------
110 # Internationalisation code
111 #--------------------------------------------------------------------------
112
113 class LanguageCs extends LanguageUtf8 {
114
115 function getBookstoreList () {
116 global $wgBookstoreListCs ;
117 return $wgBookstoreListCs ;
118 }
119
120 function getNamespaces() {
121 global $wgNamespaceNamesCs;
122 return $wgNamespaceNamesCs;
123 }
124
125 function getNsIndex( $text ) {
126 global $wgNamespaceNamesCs;
127
128 foreach ( $wgNamespaceNamesCs as $i => $n ) {
129 if ( 0 == strcasecmp( $n, $text ) ) { return $i; }
130 }
131 return false;
132 }
133
134 function getQuickbarSettings() {
135 global $wgQuickbarSettingsCs;
136 return $wgQuickbarSettingsCs;
137 }
138
139 function getSkinNames() {
140 global $wgSkinNamesCs;
141 return $wgSkinNamesCs;
142 }
143
144 function getMonthNameGen( $key ) {
145 #TODO: převést na return $this->convertGrammar( $this->getMonthName( $key ), '2sg' );
146 global $wgMonthNamesGenEn, $wgContLang;
147 // see who called us and use the correct message function
148 if( get_class( $wgContLang->getLangObj() ) == get_class( $this ) )
149 return wfMsgForContent( $wgMonthNamesGenEn[$key-1] );
150 else
151 return wfMsg( $wgMonthNamesGenEn[$key-1] );
152 }
153
154 function formatMonth( $month, $format ) {
155 return intval( $month ) . '.';
156 }
157
158 function formatDay( $day, $format ) {
159 return intval( $day ) . '.';
160 }
161
162 function getMessage( $key ) {
163 global $wgAllMessagesCs;
164 if(array_key_exists($key, $wgAllMessagesCs))
165 return $wgAllMessagesCs[$key];
166 else
167 return parent::getMessage($key);
168 }
169
170 function getAllMessages() {
171 global $wgAllMessagesCs;
172 return $wgAllMessagesCs;
173 }
174
175 function checkTitleEncoding( $s ) {
176
177 # Check for non-UTF-8 URLs; assume they are WinLatin2
178 $ishigh = preg_match( '/[\x80-\xff]/', $s);
179 $isutf = ($ishigh ? preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
180 '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s ) : true );
181
182 if( $ishigh and !$isutf ) {
183 return iconv( 'cp1250', 'utf-8', $s );
184 }
185
186 return $s;
187 }
188
189 function separatorTransformTable() {
190 return array(',' => "\xc2\xa0", '.' => ',' );
191 }
192
193 # Grammatical transformations, needed for inflected languages
194 # Invoked by putting {{grammar:case|word}} in a message
195 function convertGrammar( $word, $case ) {
196 global $wgGrammarForms;
197 if ( isset($wgGrammarForms['cs'][$case][$word]) ) {
198 return $wgGrammarForms['cs'][$case][$word];
199 }
200 # allowed values for $case:
201 # 1sg, 2sg, ..., 7sg -- nominative, genitive, ... (in singular)
202 switch ( $word ) {
203 case 'Wikipedia':
204 case 'Wikipedie':
205 switch ( $case ) {
206 case '3sg':
207 case '4sg':
208 case '6sg':
209 return 'Wikipedii';
210 case '7sg':
211 return 'Wikipedií';
212 default:
213 return 'Wikipedie';
214 }
215
216 case 'Wiktionary':
217 case 'Wikcionář':
218 switch ( $case ) {
219 case '2sg':
220 return 'Wikcionáře';
221 case '3sg':
222 case '5sg';
223 case '6sg';
224 return 'Wikcionáři';
225 case '7sg':
226 return 'Wikcionářem';
227 default:
228 return 'Wikcionář';
229 }
230
231 case 'Wikiquote':
232 case 'Wikicitáty':
233 switch ( $case ) {
234 case '2sg':
235 return 'Wikicitátů';
236 case '3sg':
237 return 'Wikicitátům';
238 case '6sg';
239 return 'Wikicitátech';
240 default:
241 return 'Wikicitáty';
242 }
243 }
244 # unknown
245 return $word;
246 }
247
248 # Plural form transformations, needed for some languages.
249 # Invoked by {{plural:count|wordform1|wordform2|wordform3}}
250 function convertPlural( $count, $wordform1, $wordform2, $wordform3) {
251 switch ( $count ) {
252 case 1:
253 return $wordform1;
254
255 case 2:
256 case 3:
257 case 4:
258 return $wordform2;
259
260 default:
261 return $wordform3;
262 };
263 }
264 }
265
266 ?>