profiling
[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 'redirect' => array( 0, '#REDIRECT', '#PŘESMĚRUJ' ),
67 'notoc' => array( 0, '__NOTOC__', '__BEZOBSAHU__' ),
68 'forcetoc' => array( 0, '__FORCETOC__', '__VŽDYOBSAH__' ),
69 'toc' => array( 0, '__TOC__', '__OBSAH__' ),
70 'noeditsection' => array( 0, '__NOEDITSECTION__', '__BEZEDITOVATČÁST__' ),
71 'start' => array( 0, '__START__', '__ZAČÁTEK__' ),
72 'currentmonth' => array( 1, 'CURRENTMONTH', 'AKTUÁLNÍMĚSÍC' ),
73 'currentmonthname' => array( 1, 'CURRENTMONTHNAME', 'AKTUÁLNÍMĚSÍCJMÉNO' ),
74 'currentmonthnamegen' => array( 1, 'CURRENTMONTHNAMEGEN', 'AKTUÁLNÍMĚSÍCGEN' ),
75 # 'currentmonthabbrev' => array( 1, 'CURRENTMONTHABBREV' 'AKTUÁLNÍMĚSÍCZKR' ),
76 'currentday' => array( 1, 'CURRENTDAY', 'AKTUÁLNÍDEN' ),
77 'currentdayname' => array( 1, 'CURRENTDAYNAME', 'AKTUÁLNÍDENJMÉNO' ),
78 'currentyear' => array( 1, 'CURRENTYEAR', 'AKTUÁLNÍROK' ),
79 'currenttime' => array( 1, 'CURRENTTIME', 'AKTUÁLNÍČAS' ),
80 'numberofarticles' => array( 1, 'NUMBEROFARTICLES', 'POČETČLÁNKŮ' ),
81 'pagename' => array( 1, 'PAGENAME', 'NÁZEVSTRANY' ),
82 'pagenamee' => array( 1, 'PAGENAMEE', 'NÁZEVSTRANYE' ),
83 'namespace' => array( 1, 'NAMESPACE', 'JMENNÝPROSTOR' ),
84 'msg' => array( 0, 'MSG:' ),
85 'subst' => array( 0, 'SUBST:', 'VLOŽIT:' ),
86 'msgnw' => array( 0, 'MSGNW:', 'VLOŽITNW:' ),
87 'end' => array( 0, '__END__', '__KONEC__' ),
88 'img_thumbnail' => array( 1, 'thumbnail', 'thumb', 'náhled' ),
89 'img_right' => array( 1, 'right', 'vpravo' ),
90 'img_left' => array( 1, 'left', 'vlevo' ),
91 'img_none' => array( 1, 'none', 'žádné' ),
92 'img_width' => array( 1, '$1px' ),
93 'img_center' => array( 1, 'center', 'centre', 'střed' ),
94 'img_framed' => array( 1, 'framed', 'enframed', 'frame', 'rám' ),
95 'int' => array( 0, 'INT:' ),
96 'sitename' => array( 1, 'SITENAME', 'NÁZEVSERVERU' ),
97 'ns' => array( 0, 'NS:' ),
98 'localurl' => array( 0, 'LOCALURL:', 'MÍSTNÍURL:' ),
99 'localurle' => array( 0, 'LOCALURLE:', 'MÍSTNÍURLE:' ),
100 'server' => array( 0, 'SERVER' ),
101 'revisionid' => array( 1, 'REVISIONID', 'IDREVIZE' )
102 );
103
104 if (!$wgCachedMessageArrays) {
105 require_once('MessagesCs.php');
106 }
107
108 #--------------------------------------------------------------------------
109 # Internationalisation code
110 #--------------------------------------------------------------------------
111
112 class LanguageCs extends LanguageUtf8 {
113
114 function getBookstoreList () {
115 global $wgBookstoreListCs ;
116 return $wgBookstoreListCs ;
117 }
118
119 function getNamespaces() {
120 global $wgNamespaceNamesCs;
121 return $wgNamespaceNamesCs;
122 }
123
124 function getNsIndex( $text ) {
125 global $wgNamespaceNamesCs;
126
127 foreach ( $wgNamespaceNamesCs as $i => $n ) {
128 if ( 0 == strcasecmp( $n, $text ) ) { return $i; }
129 }
130 return false;
131 }
132
133 function getQuickbarSettings() {
134 global $wgQuickbarSettingsCs;
135 return $wgQuickbarSettingsCs;
136 }
137
138 function getSkinNames() {
139 global $wgSkinNamesCs;
140 return $wgSkinNamesCs;
141 }
142
143 function getMonthNameGen( $key ) {
144 #TODO: převést na return $this->convertGrammar( $this->getMonthName( $key ), '2sg' );
145 global $wgMonthNamesGenEn, $wgContLang;
146 // see who called us and use the correct message function
147 if( get_class( $wgContLang->getLangObj() ) == get_class( $this ) )
148 return wfMsgForContent( $wgMonthNamesGenEn[$key-1] );
149 else
150 return wfMsg( $wgMonthNamesGenEn[$key-1] );
151 }
152
153 function formatMonth( $month, $format ) {
154 return intval( $month ) . '.';
155 }
156
157 function formatDay( $day, $format ) {
158 return intval( $day ) . '.';
159 }
160
161 function getMessage( $key ) {
162 global $wgAllMessagesCs;
163 if(array_key_exists($key, $wgAllMessagesCs))
164 return $wgAllMessagesCs[$key];
165 else
166 return parent::getMessage($key);
167 }
168
169 function getAllMessages() {
170 global $wgAllMessagesCs;
171 return $wgAllMessagesCs;
172 }
173
174 function checkTitleEncoding( $s ) {
175
176 # Check for non-UTF-8 URLs; assume they are WinLatin2
177 $ishigh = preg_match( '/[\x80-\xff]/', $s);
178 $isutf = ($ishigh ? preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' .
179 '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})+$/', $s ) : true );
180
181 if( $ishigh and !$isutf ) {
182 return iconv( 'cp1250', 'utf-8', $s );
183 }
184
185 return $s;
186 }
187
188 function separatorTransformTable() {
189 return array(',' => "\xc2\xa0", '.' => ',' );
190 }
191
192 # Grammatical transformations, needed for inflected languages
193 # Invoked by putting {{grammar:case|word}} in a message
194 function convertGrammar( $word, $case ) {
195 global $wgGrammarForms;
196 if ( isset($wgGrammarForms['cs'][$case][$word]) ) {
197 return $wgGrammarForms['cs'][$case][$word];
198 }
199 # allowed values for $case:
200 # 1sg, 2sg, ..., 7sg -- nominative, genitive, ... (in singular)
201 switch ( $word ) {
202 case 'Wikipedia':
203 case 'Wikipedie':
204 switch ( $case ) {
205 case '3sg':
206 case '4sg':
207 case '6sg':
208 return 'Wikipedii';
209 case '7sg':
210 return 'Wikipedií';
211 default:
212 return 'Wikipedie';
213 }
214
215 case 'Wiktionary':
216 case 'Wikcionář':
217 switch ( $case ) {
218 case '2sg':
219 return 'Wikcionáře';
220 case '3sg':
221 case '5sg';
222 case '6sg';
223 return 'Wikcionáři';
224 case '7sg':
225 return 'Wikcionářem';
226 default:
227 return 'Wikcionář';
228 }
229
230 case 'Wikiquote':
231 case 'Wikicitáty':
232 switch ( $case ) {
233 case '2sg':
234 return 'Wikicitátů';
235 case '3sg':
236 return 'Wikicitátům';
237 case '6sg';
238 return 'Wikicitátech';
239 default:
240 return 'Wikicitáty';
241 }
242 }
243 # unknown
244 return $word;
245 }
246
247 # Plural form transformations, needed for some languages.
248 # Invoked by {{plural:count|wordform1|wordform2|wordform3}}
249 function convertPlural( $count, $wordform1, $wordform2, $wordform3) {
250 switch ( $count ) {
251 case 1:
252 return $wordform1;
253
254 case 2:
255 case 3:
256 case 4:
257 return $wordform2;
258
259 default:
260 return $wordform3;
261 };
262 }
263 }
264
265 ?>