* (bug 5349) Update for Portuguese messages (pt)
[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
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 global $wgInputEncoding;
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 var $digitTransTable = array(
190 ',' => "\xc2\xa0", // @bug 2749
191 '.' => ','
192 );
193
194 function formatNum( $number, $year = false ) {
195 return $year ? $number : strtr($this->commafy($number), $this->digitTransTable);
196 }
197
198 # Grammatical transformations, needed for inflected languages
199 # Invoked by putting {{grammar:case|word}} in a message
200 function convertGrammar( $word, $case ) {
201 # allowed values for $case:
202 # 1sg, 2sg, ..., 7sg -- nominative, genitive, ... (in singular)
203 switch ( $word ) {
204 case 'Wikipedia':
205 case 'Wikipedie':
206 switch ( $case ) {
207 case '3sg':
208 case '4sg':
209 case '6sg':
210 return 'Wikipedii';
211 case '7sg':
212 return 'Wikipedií';
213 default:
214 return 'Wikipedie';
215 }
216
217 case 'Wiktionary':
218 case 'Wikcionář':
219 switch ( $case ) {
220 case '2sg':
221 return 'Wikcionáře';
222 case '3sg':
223 case '5sg';
224 case '6sg';
225 return 'Wikcionáři';
226 case '7sg':
227 return 'Wikcionářem';
228 default:
229 return 'Wikcionář';
230 }
231
232 case 'Wikiquote':
233 case 'Wikicitáty':
234 switch ( $case ) {
235 case '2sg':
236 return 'Wikicitátů';
237 case '3sg':
238 return 'Wikicitátům';
239 case '6sg';
240 return 'Wikicitátech';
241 default:
242 return 'Wikicitáty';
243 }
244 }
245 # unknown
246 return $word;
247 }
248 }
249
250 ?>