Mercurial > hg > Members > shoshi > webvirt
comparison cake/tests/cases/libs/l10n.test.php @ 0:261e66bd5a0c
hg init
author | Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 24 Jul 2011 21:08:31 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:261e66bd5a0c |
---|---|
1 <?php | |
2 /** | |
3 * L10nTest file | |
4 * | |
5 * PHP versions 4 and 5 | |
6 * | |
7 * CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing> | |
8 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) | |
9 * | |
10 * Licensed under The Open Group Test Suite License | |
11 * Redistributions of files must retain the above copyright notice. | |
12 * | |
13 * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) | |
14 * @link http://book.cakephp.org/view/1196/Testing CakePHP(tm) Tests | |
15 * @package cake | |
16 * @subpackage cake.tests.cases.libs | |
17 * @since CakePHP(tm) v 1.2.0.5432 | |
18 * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License | |
19 */ | |
20 App::import('Core', 'l10n'); | |
21 | |
22 /** | |
23 * L10nTest class | |
24 * | |
25 * @package cake | |
26 * @subpackage cake.tests.cases.libs | |
27 */ | |
28 class L10nTest extends CakeTestCase { | |
29 | |
30 /** | |
31 * testGet method | |
32 * | |
33 * @access public | |
34 * @return void | |
35 */ | |
36 function testGet() { | |
37 $l10n =& new L10n(); | |
38 | |
39 // Catalog Entry | |
40 $l10n->get('en'); | |
41 | |
42 $this->assertEqual($l10n->language, 'English'); | |
43 $this->assertEqual($l10n->languagePath, array('eng', 'eng')); | |
44 $this->assertEqual($l10n->locale, 'eng'); | |
45 | |
46 // Map Entry | |
47 $l10n->get('eng'); | |
48 | |
49 $this->assertEqual($l10n->language, 'English'); | |
50 $this->assertEqual($l10n->languagePath, array('eng', 'eng')); | |
51 $this->assertEqual($l10n->locale, 'eng'); | |
52 | |
53 // Catalog Entry | |
54 $l10n->get('en-ca'); | |
55 | |
56 $this->assertEqual($l10n->language, 'English (Canadian)'); | |
57 $this->assertEqual($l10n->languagePath, array('en_ca', 'eng')); | |
58 $this->assertEqual($l10n->locale, 'en_ca'); | |
59 | |
60 // Default Entry | |
61 define('DEFAULT_LANGUAGE', 'en-us'); | |
62 | |
63 $l10n->get('use_default'); | |
64 | |
65 $this->assertEqual($l10n->language, 'English (United States)'); | |
66 $this->assertEqual($l10n->languagePath, array('en_us', 'eng')); | |
67 $this->assertEqual($l10n->locale, 'en_us'); | |
68 | |
69 $l10n->get('es'); | |
70 $l10n->get(''); | |
71 $this->assertEqual($l10n->lang, 'en-us'); | |
72 | |
73 | |
74 // Using $this->default | |
75 $l10n = new L10n(); | |
76 | |
77 $l10n->get('use_default'); | |
78 $this->assertEqual($l10n->language, 'English (United States)'); | |
79 $this->assertEqual($l10n->languagePath, array('en_us', 'eng', 'eng')); | |
80 $this->assertEqual($l10n->locale, 'en_us'); | |
81 } | |
82 | |
83 /** | |
84 * testGetAutoLanguage method | |
85 * | |
86 * @access public | |
87 * @return void | |
88 */ | |
89 function testGetAutoLanguage() { | |
90 $__SERVER = $_SERVER; | |
91 $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'inexistent,en-ca'; | |
92 | |
93 $l10n =& new L10n(); | |
94 $l10n->get(); | |
95 | |
96 $this->assertEqual($l10n->language, 'English (Canadian)'); | |
97 $this->assertEqual($l10n->languagePath, array('en_ca', 'eng', 'eng')); | |
98 $this->assertEqual($l10n->locale, 'en_ca'); | |
99 | |
100 $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'es_mx'; | |
101 $l10n->get(); | |
102 | |
103 $this->assertEqual($l10n->language, 'Spanish (Mexican)'); | |
104 $this->assertEqual($l10n->languagePath, array('es_mx', 'spa', 'eng')); | |
105 $this->assertEqual($l10n->locale, 'es_mx'); | |
106 | |
107 $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'en_xy,en_ca'; | |
108 $l10n->get(); | |
109 | |
110 $this->assertEqual($l10n->language, 'English'); | |
111 $this->assertEqual($l10n->languagePath, array('eng', 'eng', 'eng')); | |
112 $this->assertEqual($l10n->locale, 'eng'); | |
113 | |
114 $_SERVER = $__SERVER; | |
115 } | |
116 | |
117 /** | |
118 * testMap method | |
119 * | |
120 * @access public | |
121 * @return void | |
122 */ | |
123 function testMap() { | |
124 $l10n =& new L10n(); | |
125 | |
126 $result = $l10n->map(array('afr', 'af')); | |
127 $expected = array('afr' => 'af', 'af' => 'afr'); | |
128 $this->assertEqual($result, $expected); | |
129 | |
130 $result = $l10n->map(array('alb', 'sq')); | |
131 $expected = array('alb' => 'sq', 'sq' => 'alb'); | |
132 $this->assertEqual($result, $expected); | |
133 | |
134 $result = $l10n->map(array('ara', 'ar')); | |
135 $expected = array('ara' => 'ar', 'ar' => 'ara'); | |
136 $this->assertEqual($result, $expected); | |
137 | |
138 $result = $l10n->map(array('hye', 'hy')); | |
139 $expected = array('hye' => 'hy', 'hy' => 'hye'); | |
140 $this->assertEqual($result, $expected); | |
141 | |
142 $result = $l10n->map(array('baq', 'eu')); | |
143 $expected = array('baq' => 'eu', 'eu' => 'baq'); | |
144 $this->assertEqual($result, $expected); | |
145 | |
146 $result = $l10n->map(array('baq', 'eu')); | |
147 $expected = array('baq' => 'eu', 'eu' => 'baq'); | |
148 $this->assertEqual($result, $expected); | |
149 | |
150 $result = $l10n->map(array('bos', 'bs')); | |
151 $expected = array('bos' => 'bs', 'bs' => 'bos'); | |
152 $this->assertEqual($result, $expected); | |
153 | |
154 $result = $l10n->map(array('bul', 'bg')); | |
155 $expected = array('bul' => 'bg', 'bg' => 'bul'); | |
156 $this->assertEqual($result, $expected); | |
157 | |
158 $result = $l10n->map(array('bel', 'be')); | |
159 $expected = array('bel' => 'be', 'be' => 'bel'); | |
160 $this->assertEqual($result, $expected); | |
161 | |
162 $result = $l10n->map(array('cat', 'ca')); | |
163 $expected = array('cat' => 'ca', 'ca' => 'cat'); | |
164 $this->assertEqual($result, $expected); | |
165 | |
166 $result = $l10n->map(array('chi', 'zh')); | |
167 $expected = array('chi' => 'zh', 'zh' => 'chi'); | |
168 $this->assertEqual($result, $expected); | |
169 | |
170 $result = $l10n->map(array('zho', 'zh')); | |
171 $expected = array('zho' => 'zh', 'zh' => 'chi'); | |
172 $this->assertEqual($result, $expected); | |
173 | |
174 $result = $l10n->map(array('hrv', 'hr')); | |
175 $expected = array('hrv' => 'hr', 'hr' => 'hrv'); | |
176 $this->assertEqual($result, $expected); | |
177 | |
178 $result = $l10n->map(array('ces', 'cs')); | |
179 $expected = array('ces' => 'cs', 'cs' => 'cze'); | |
180 $this->assertEqual($result, $expected); | |
181 | |
182 $result = $l10n->map(array('cze', 'cs')); | |
183 $expected = array('cze' => 'cs', 'cs' => 'cze'); | |
184 $this->assertEqual($result, $expected); | |
185 | |
186 $result = $l10n->map(array('dan', 'da')); | |
187 $expected = array('dan' => 'da', 'da' => 'dan'); | |
188 $this->assertEqual($result, $expected); | |
189 | |
190 $result = $l10n->map(array('dut', 'nl')); | |
191 $expected = array('dut' => 'nl', 'nl' => 'dut'); | |
192 $this->assertEqual($result, $expected); | |
193 | |
194 $result = $l10n->map(array('nld', 'nl')); | |
195 $expected = array('nld' => 'nl', 'nl' => 'dut'); | |
196 $this->assertEqual($result, $expected); | |
197 | |
198 $result = $l10n->map(array('nld')); | |
199 $expected = array('nld' => 'nl'); | |
200 $this->assertEqual($result, $expected); | |
201 | |
202 $result = $l10n->map(array('eng', 'en')); | |
203 $expected = array('eng' => 'en', 'en' => 'eng'); | |
204 $this->assertEqual($result, $expected); | |
205 | |
206 $result = $l10n->map(array('est', 'et')); | |
207 $expected = array('est' => 'et', 'et' => 'est'); | |
208 $this->assertEqual($result, $expected); | |
209 | |
210 $result = $l10n->map(array('fao', 'fo')); | |
211 $expected = array('fao' => 'fo', 'fo' => 'fao'); | |
212 $this->assertEqual($result, $expected); | |
213 | |
214 $result = $l10n->map(array('fas', 'fa')); | |
215 $expected = array('fas' => 'fa', 'fa' => 'fas'); | |
216 $this->assertEqual($result, $expected); | |
217 | |
218 $result = $l10n->map(array('per', 'fa')); | |
219 $expected = array('per' => 'fa', 'fa' => 'fas'); | |
220 $this->assertEqual($result, $expected); | |
221 | |
222 $result = $l10n->map(array('fin', 'fi')); | |
223 $expected = array('fin' => 'fi', 'fi' => 'fin'); | |
224 $this->assertEqual($result, $expected); | |
225 | |
226 $result = $l10n->map(array('fra', 'fr')); | |
227 $expected = array('fra' => 'fr', 'fr' => 'fre'); | |
228 $this->assertEqual($result, $expected); | |
229 | |
230 $result = $l10n->map(array('fre', 'fr')); | |
231 $expected = array('fre' => 'fr', 'fr' => 'fre'); | |
232 $this->assertEqual($result, $expected); | |
233 | |
234 $result = $l10n->map(array('gla', 'gd')); | |
235 $expected = array('gla' => 'gd', 'gd' => 'gla'); | |
236 $this->assertEqual($result, $expected); | |
237 | |
238 $result = $l10n->map(array('glg', 'gl')); | |
239 $expected = array('glg' => 'gl', 'gl' => 'glg'); | |
240 $this->assertEqual($result, $expected); | |
241 | |
242 $result = $l10n->map(array('deu', 'de')); | |
243 $expected = array('deu' => 'de', 'de' => 'deu'); | |
244 $this->assertEqual($result, $expected); | |
245 | |
246 $result = $l10n->map(array('ger', 'de')); | |
247 $expected = array('ger' => 'de', 'de' => 'deu'); | |
248 $this->assertEqual($result, $expected); | |
249 | |
250 $result = $l10n->map(array('ell', 'el')); | |
251 $expected = array('ell' => 'el', 'el' => 'gre'); | |
252 $this->assertEqual($result, $expected); | |
253 | |
254 $result = $l10n->map(array('gre', 'el')); | |
255 $expected = array('gre' => 'el', 'el' => 'gre'); | |
256 $this->assertEqual($result, $expected); | |
257 | |
258 $result = $l10n->map(array('heb', 'he')); | |
259 $expected = array('heb' => 'he', 'he' => 'heb'); | |
260 $this->assertEqual($result, $expected); | |
261 | |
262 $result = $l10n->map(array('hin', 'hi')); | |
263 $expected = array('hin' => 'hi', 'hi' => 'hin'); | |
264 $this->assertEqual($result, $expected); | |
265 | |
266 $result = $l10n->map(array('hun', 'hu')); | |
267 $expected = array('hun' => 'hu', 'hu' => 'hun'); | |
268 $this->assertEqual($result, $expected); | |
269 | |
270 $result = $l10n->map(array('ice', 'is')); | |
271 $expected = array('ice' => 'is', 'is' => 'ice'); | |
272 $this->assertEqual($result, $expected); | |
273 | |
274 $result = $l10n->map(array('isl', 'is')); | |
275 $expected = array('isl' => 'is', 'is' => 'ice'); | |
276 $this->assertEqual($result, $expected); | |
277 | |
278 $result = $l10n->map(array('ind', 'id')); | |
279 $expected = array('ind' => 'id', 'id' => 'ind'); | |
280 $this->assertEqual($result, $expected); | |
281 | |
282 $result = $l10n->map(array('gle', 'ga')); | |
283 $expected = array('gle' => 'ga', 'ga' => 'gle'); | |
284 $this->assertEqual($result, $expected); | |
285 | |
286 $result = $l10n->map(array('ita', 'it')); | |
287 $expected = array('ita' => 'it', 'it' => 'ita'); | |
288 $this->assertEqual($result, $expected); | |
289 | |
290 $result = $l10n->map(array('jpn', 'ja')); | |
291 $expected = array('jpn' => 'ja', 'ja' => 'jpn'); | |
292 $this->assertEqual($result, $expected); | |
293 | |
294 $result = $l10n->map(array('kor', 'ko')); | |
295 $expected = array('kor' => 'ko', 'ko' => 'kor'); | |
296 $this->assertEqual($result, $expected); | |
297 | |
298 $result = $l10n->map(array('lav', 'lv')); | |
299 $expected = array('lav' => 'lv', 'lv' => 'lav'); | |
300 $this->assertEqual($result, $expected); | |
301 | |
302 $result = $l10n->map(array('lit', 'lt')); | |
303 $expected = array('lit' => 'lt', 'lt' => 'lit'); | |
304 $this->assertEqual($result, $expected); | |
305 | |
306 $result = $l10n->map(array('mac', 'mk')); | |
307 $expected = array('mac' => 'mk', 'mk' => 'mac'); | |
308 $this->assertEqual($result, $expected); | |
309 | |
310 $result = $l10n->map(array('mkd', 'mk')); | |
311 $expected = array('mkd' => 'mk', 'mk' => 'mac'); | |
312 $this->assertEqual($result, $expected); | |
313 | |
314 $result = $l10n->map(array('may', 'ms')); | |
315 $expected = array('may' => 'ms', 'ms' => 'may'); | |
316 $this->assertEqual($result, $expected); | |
317 | |
318 $result = $l10n->map(array('msa', 'ms')); | |
319 $expected = array('msa' => 'ms', 'ms' => 'may'); | |
320 $this->assertEqual($result, $expected); | |
321 | |
322 $result = $l10n->map(array('mlt', 'mt')); | |
323 $expected = array('mlt' => 'mt', 'mt' => 'mlt'); | |
324 $this->assertEqual($result, $expected); | |
325 | |
326 $result = $l10n->map(array('nor', 'no')); | |
327 $expected = array('nor' => 'no', 'no' => 'nor'); | |
328 $this->assertEqual($result, $expected); | |
329 | |
330 $result = $l10n->map(array('nob', 'nb')); | |
331 $expected = array('nob' => 'nb', 'nb' => 'nob'); | |
332 $this->assertEqual($result, $expected); | |
333 | |
334 $result = $l10n->map(array('nno', 'nn')); | |
335 $expected = array('nno' => 'nn', 'nn' => 'nno'); | |
336 $this->assertEqual($result, $expected); | |
337 | |
338 $result = $l10n->map(array('pol', 'pl')); | |
339 $expected = array('pol' => 'pl', 'pl' => 'pol'); | |
340 $this->assertEqual($result, $expected); | |
341 | |
342 $result = $l10n->map(array('por', 'pt')); | |
343 $expected = array('por' => 'pt', 'pt' => 'por'); | |
344 $this->assertEqual($result, $expected); | |
345 | |
346 $result = $l10n->map(array('roh', 'rm')); | |
347 $expected = array('roh' => 'rm', 'rm' => 'roh'); | |
348 $this->assertEqual($result, $expected); | |
349 | |
350 $result = $l10n->map(array('ron', 'ro')); | |
351 $expected = array('ron' => 'ro', 'ro' => 'rum'); | |
352 $this->assertEqual($result, $expected); | |
353 | |
354 $result = $l10n->map(array('rum', 'ro')); | |
355 $expected = array('rum' => 'ro', 'ro' => 'rum'); | |
356 $this->assertEqual($result, $expected); | |
357 | |
358 $result = $l10n->map(array('rus', 'ru')); | |
359 $expected = array('rus' => 'ru', 'ru' => 'rus'); | |
360 $this->assertEqual($result, $expected); | |
361 | |
362 $result = $l10n->map(array('smi', 'sz')); | |
363 $expected = array('smi' => 'sz', 'sz' => 'smi'); | |
364 $this->assertEqual($result, $expected); | |
365 | |
366 $result = $l10n->map(array('scc', 'sr')); | |
367 $expected = array('scc' => 'sr', 'sr' => 'scc'); | |
368 $this->assertEqual($result, $expected); | |
369 | |
370 $result = $l10n->map(array('srp', 'sr')); | |
371 $expected = array('srp' => 'sr', 'sr' => 'scc'); | |
372 $this->assertEqual($result, $expected); | |
373 | |
374 $result = $l10n->map(array('slk', 'sk')); | |
375 $expected = array('slk' => 'sk', 'sk' => 'slo'); | |
376 $this->assertEqual($result, $expected); | |
377 | |
378 $result = $l10n->map(array('slo', 'sk')); | |
379 $expected = array('slo' => 'sk', 'sk' => 'slo'); | |
380 $this->assertEqual($result, $expected); | |
381 | |
382 $result = $l10n->map(array('slv', 'sl')); | |
383 $expected = array('slv' => 'sl', 'sl' => 'slv'); | |
384 $this->assertEqual($result, $expected); | |
385 | |
386 $result = $l10n->map(array('wen', 'sb')); | |
387 $expected = array('wen' => 'sb', 'sb' => 'wen'); | |
388 $this->assertEqual($result, $expected); | |
389 | |
390 $result = $l10n->map(array('spa', 'es')); | |
391 $expected = array('spa' => 'es', 'es' => 'spa'); | |
392 $this->assertEqual($result, $expected); | |
393 | |
394 $result = $l10n->map(array('swe', 'sv')); | |
395 $expected = array('swe' => 'sv', 'sv' => 'swe'); | |
396 $this->assertEqual($result, $expected); | |
397 | |
398 $result = $l10n->map(array('tha', 'th')); | |
399 $expected = array('tha' => 'th', 'th' => 'tha'); | |
400 $this->assertEqual($result, $expected); | |
401 | |
402 $result = $l10n->map(array('tso', 'ts')); | |
403 $expected = array('tso' => 'ts', 'ts' => 'tso'); | |
404 $this->assertEqual($result, $expected); | |
405 | |
406 $result = $l10n->map(array('tsn', 'tn')); | |
407 $expected = array('tsn' => 'tn', 'tn' => 'tsn'); | |
408 $this->assertEqual($result, $expected); | |
409 | |
410 $result = $l10n->map(array('tur', 'tr')); | |
411 $expected = array('tur' => 'tr', 'tr' => 'tur'); | |
412 $this->assertEqual($result, $expected); | |
413 | |
414 $result = $l10n->map(array('ukr', 'uk')); | |
415 $expected = array('ukr' => 'uk', 'uk' => 'ukr'); | |
416 $this->assertEqual($result, $expected); | |
417 | |
418 $result = $l10n->map(array('urd', 'ur')); | |
419 $expected = array('urd' => 'ur', 'ur' => 'urd'); | |
420 $this->assertEqual($result, $expected); | |
421 | |
422 $result = $l10n->map(array('ven', 've')); | |
423 $expected = array('ven' => 've', 've' => 'ven'); | |
424 $this->assertEqual($result, $expected); | |
425 | |
426 $result = $l10n->map(array('vie', 'vi')); | |
427 $expected = array('vie' => 'vi', 'vi' => 'vie'); | |
428 $this->assertEqual($result, $expected); | |
429 | |
430 $result = $l10n->map(array('xho', 'xh')); | |
431 $expected = array('xho' => 'xh', 'xh' => 'xho'); | |
432 $this->assertEqual($result, $expected); | |
433 | |
434 $result = $l10n->map(array('cy', 'cym')); | |
435 $expected = array('cym' => 'cy', 'cy' => 'cym'); | |
436 $this->assertEqual($result, $expected); | |
437 | |
438 $result = $l10n->map(array('yid', 'yi')); | |
439 $expected = array('yid' => 'yi', 'yi' => 'yid'); | |
440 $this->assertEqual($result, $expected); | |
441 | |
442 $result = $l10n->map(array('zul', 'zu')); | |
443 $expected = array('zul' => 'zu', 'zu' => 'zul'); | |
444 $this->assertEqual($result, $expected); | |
445 } | |
446 | |
447 /** | |
448 * testCatalog method | |
449 * | |
450 * @access public | |
451 * @return void | |
452 */ | |
453 function testCatalog() { | |
454 $l10n =& new L10n(); | |
455 | |
456 $result = $l10n->catalog(array('af')); | |
457 $expected = array( | |
458 'af' => array('language' => 'Afrikaans', 'locale' => 'afr', 'localeFallback' => 'afr', 'charset' => 'utf-8', 'direction' => 'ltr') | |
459 ); | |
460 $this->assertEqual($result, $expected); | |
461 | |
462 $result = $l10n->catalog(array('ar', 'ar-ae', 'ar-bh', 'ar-dz', 'ar-eg', 'ar-iq', 'ar-jo', 'ar-kw', 'ar-lb', 'ar-ly', 'ar-ma', | |
463 'ar-om', 'ar-qa', 'ar-sa', 'ar-sy', 'ar-tn', 'ar-ye')); | |
464 $expected = array( | |
465 'ar' => array('language' => 'Arabic', 'locale' => 'ara', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'), | |
466 'ar-ae' => array('language' => 'Arabic (U.A.E.)', 'locale' => 'ar_ae', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'), | |
467 'ar-bh' => array('language' => 'Arabic (Bahrain)', 'locale' => 'ar_bh', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'), | |
468 'ar-dz' => array('language' => 'Arabic (Algeria)', 'locale' => 'ar_dz', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'), | |
469 'ar-eg' => array('language' => 'Arabic (Egypt)', 'locale' => 'ar_eg', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'), | |
470 'ar-iq' => array('language' => 'Arabic (Iraq)', 'locale' => 'ar_iq', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'), | |
471 'ar-jo' => array('language' => 'Arabic (Jordan)', 'locale' => 'ar_jo', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'), | |
472 'ar-kw' => array('language' => 'Arabic (Kuwait)', 'locale' => 'ar_kw', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'), | |
473 'ar-lb' => array('language' => 'Arabic (Lebanon)', 'locale' => 'ar_lb', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'), | |
474 'ar-ly' => array('language' => 'Arabic (Libya)', 'locale' => 'ar_ly', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'), | |
475 'ar-ma' => array('language' => 'Arabic (Morocco)', 'locale' => 'ar_ma', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'), | |
476 'ar-om' => array('language' => 'Arabic (Oman)', 'locale' => 'ar_om', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'), | |
477 'ar-qa' => array('language' => 'Arabic (Qatar)', 'locale' => 'ar_qa', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'), | |
478 'ar-sa' => array('language' => 'Arabic (Saudi Arabia)', 'locale' => 'ar_sa', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'), | |
479 'ar-sy' => array('language' => 'Arabic (Syria)', 'locale' => 'ar_sy', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'), | |
480 'ar-tn' => array('language' => 'Arabic (Tunisia)', 'locale' => 'ar_tn', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'), | |
481 'ar-ye' => array('language' => 'Arabic (Yemen)', 'locale' => 'ar_ye', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl') | |
482 ); | |
483 $this->assertEqual($result, $expected); | |
484 | |
485 $result = $l10n->catalog(array('be')); | |
486 $expected = array( | |
487 'be' => array('language' => 'Byelorussian', 'locale' => 'bel', 'localeFallback' => 'bel', 'charset' => 'utf-8', 'direction' => 'ltr') | |
488 ); | |
489 $this->assertEqual($result, $expected); | |
490 | |
491 $result = $l10n->catalog(array('bg')); | |
492 $expected = array( | |
493 'bg' => array('language' => 'Bulgarian', 'locale' => 'bul', 'localeFallback' => 'bul', 'charset' => 'utf-8', 'direction' => 'ltr') | |
494 ); | |
495 $this->assertEqual($result, $expected); | |
496 | |
497 $result = $l10n->catalog(array('bs')); | |
498 $expected = array( | |
499 'bs' => array('language' => 'Bosnian', 'locale' => 'bos', 'localeFallback' => 'bos', 'charset' => 'utf-8', 'direction' => 'ltr') | |
500 ); | |
501 $this->assertEqual($result, $expected); | |
502 | |
503 $result = $l10n->catalog(array('ca')); | |
504 $expected = array( | |
505 'ca' => array('language' => 'Catalan', 'locale' => 'cat', 'localeFallback' => 'cat', 'charset' => 'utf-8', 'direction' => 'ltr') | |
506 ); | |
507 $this->assertEqual($result, $expected); | |
508 | |
509 $result = $l10n->catalog(array('cs')); | |
510 $expected = array( | |
511 'cs' => array('language' => 'Czech', 'locale' => 'cze', 'localeFallback' => 'cze', 'charset' => 'utf-8', 'direction' => 'ltr') | |
512 ); | |
513 $this->assertEqual($result, $expected); | |
514 | |
515 $result = $l10n->catalog(array('da')); | |
516 $expected = array( | |
517 'da' => array('language' => 'Danish', 'locale' => 'dan', 'localeFallback' => 'dan', 'charset' => 'utf-8', 'direction' => 'ltr') | |
518 ); | |
519 $this->assertEqual($result, $expected); | |
520 | |
521 $result = $l10n->catalog(array('de', 'de-at', 'de-ch', 'de-de', 'de-li', 'de-lu')); | |
522 $expected = array( | |
523 'de' => array('language' => 'German (Standard)', 'locale' => 'deu', 'localeFallback' => 'deu', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
524 'de-at' => array('language' => 'German (Austria)', 'locale' => 'de_at', 'localeFallback' => 'deu', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
525 'de-ch' => array('language' => 'German (Swiss)', 'locale' => 'de_ch', 'localeFallback' => 'deu', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
526 'de-de' => array('language' => 'German (Germany)', 'locale' => 'de_de', 'localeFallback' => 'deu', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
527 'de-li' => array('language' => 'German (Liechtenstein)', 'locale' => 'de_li', 'localeFallback' => 'deu', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
528 'de-lu' => array('language' => 'German (Luxembourg)', 'locale' => 'de_lu', 'localeFallback' => 'deu', 'charset' => 'utf-8', 'direction' => 'ltr') | |
529 ); | |
530 $this->assertEqual($result, $expected); | |
531 | |
532 $result = $l10n->catalog(array('e', 'el')); | |
533 $expected = array( | |
534 'e' => array('language' => 'Greek', 'locale' => 'gre', 'localeFallback' => 'gre', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
535 'el' => array('language' => 'Greek', 'locale' => 'gre', 'localeFallback' => 'gre', 'charset' => 'utf-8', 'direction' => 'ltr') | |
536 ); | |
537 $this->assertEqual($result, $expected); | |
538 | |
539 $result = $l10n->catalog(array('en', 'en-au', 'en-bz', 'en-ca', 'en-gb', 'en-ie', 'en-jm', 'en-nz', 'en-tt', 'en-us', 'en-za')); | |
540 $expected = array( | |
541 'en' => array('language' => 'English', 'locale' => 'eng', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
542 'en-au' => array('language' => 'English (Australian)', 'locale' => 'en_au', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
543 'en-bz' => array('language' => 'English (Belize)', 'locale' => 'en_bz', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
544 'en-ca' => array('language' => 'English (Canadian)', 'locale' => 'en_ca', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
545 'en-gb' => array('language' => 'English (British)', 'locale' => 'en_gb', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
546 'en-ie' => array('language' => 'English (Ireland)', 'locale' => 'en_ie', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
547 'en-jm' => array('language' => 'English (Jamaica)', 'locale' => 'en_jm', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
548 'en-nz' => array('language' => 'English (New Zealand)', 'locale' => 'en_nz', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
549 'en-tt' => array('language' => 'English (Trinidad)', 'locale' => 'en_tt', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
550 'en-us' => array('language' => 'English (United States)', 'locale' => 'en_us', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
551 'en-za' => array('language' => 'English (South Africa)', 'locale' => 'en_za', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr') | |
552 ); | |
553 $this->assertEqual($result, $expected); | |
554 | |
555 $result = $l10n->catalog(array('es', 'es-ar', 'es-bo', 'es-cl', 'es-co', 'es-cr', 'es-do', 'es-ec', 'es-es', 'es-gt', 'es-hn', | |
556 'es-mx', 'es-ni', 'es-pa', 'es-pe', 'es-pr', 'es-py', 'es-sv', 'es-uy', 'es-ve')); | |
557 $expected = array( | |
558 'es' => array('language' => 'Spanish (Spain - Traditional)', 'locale' => 'spa', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
559 'es-ar' => array('language' => 'Spanish (Argentina)', 'locale' => 'es_ar', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
560 'es-bo' => array('language' => 'Spanish (Bolivia)', 'locale' => 'es_bo', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
561 'es-cl' => array('language' => 'Spanish (Chile)', 'locale' => 'es_cl', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
562 'es-co' => array('language' => 'Spanish (Colombia)', 'locale' => 'es_co', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
563 'es-cr' => array('language' => 'Spanish (Costa Rica)', 'locale' => 'es_cr', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
564 'es-do' => array('language' => 'Spanish (Dominican Republic)', 'locale' => 'es_do', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
565 'es-ec' => array('language' => 'Spanish (Ecuador)', 'locale' => 'es_ec', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
566 'es-es' => array('language' => 'Spanish (Spain)', 'locale' => 'es_es', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
567 'es-gt' => array('language' => 'Spanish (Guatemala)', 'locale' => 'es_gt', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
568 'es-hn' => array('language' => 'Spanish (Honduras)', 'locale' => 'es_hn', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
569 'es-mx' => array('language' => 'Spanish (Mexican)', 'locale' => 'es_mx', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
570 'es-ni' => array('language' => 'Spanish (Nicaragua)', 'locale' => 'es_ni', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
571 'es-pa' => array('language' => 'Spanish (Panama)', 'locale' => 'es_pa', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
572 'es-pe' => array('language' => 'Spanish (Peru)', 'locale' => 'es_pe', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
573 'es-pr' => array('language' => 'Spanish (Puerto Rico)', 'locale' => 'es_pr', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
574 'es-py' => array('language' => 'Spanish (Paraguay)', 'locale' => 'es_py', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
575 'es-sv' => array('language' => 'Spanish (El Salvador)', 'locale' => 'es_sv', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
576 'es-uy' => array('language' => 'Spanish (Uruguay)', 'locale' => 'es_uy', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
577 'es-ve' => array('language' => 'Spanish (Venezuela)', 'locale' => 'es_ve', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr') | |
578 ); | |
579 $this->assertEqual($result, $expected); | |
580 | |
581 $result = $l10n->catalog(array('et')); | |
582 $expected = array( | |
583 'et' => array('language' => 'Estonian', 'locale' => 'est', 'localeFallback' => 'est', 'charset' => 'utf-8', 'direction' => 'ltr') | |
584 ); | |
585 $this->assertEqual($result, $expected); | |
586 | |
587 $result = $l10n->catalog(array('eu')); | |
588 $expected = array( | |
589 'eu' => array('language' => 'Basque', 'locale' => 'baq', 'localeFallback' => 'baq', 'charset' => 'utf-8', 'direction' => 'ltr') | |
590 ); | |
591 $this->assertEqual($result, $expected); | |
592 | |
593 $result = $l10n->catalog(array('fa')); | |
594 $expected = array( | |
595 'fa' => array('language' => 'Farsi', 'locale' => 'per', 'localeFallback' => 'per', 'charset' => 'utf-8', 'direction' => 'rtl') | |
596 ); | |
597 $this->assertEqual($result, $expected); | |
598 | |
599 $result = $l10n->catalog(array('fi')); | |
600 $expected = array( | |
601 'fi' => array('language' => 'Finnish', 'locale' => 'fin', 'localeFallback' => 'fin', 'charset' => 'utf-8', 'direction' => 'ltr') | |
602 ); | |
603 $this->assertEqual($result, $expected); | |
604 | |
605 $result = $l10n->catalog(array('fo')); | |
606 $expected = array( | |
607 'fo' => array('language' => 'Faeroese', 'locale' => 'fao', 'localeFallback' => 'fao', 'charset' => 'utf-8', 'direction' => 'ltr') | |
608 ); | |
609 $this->assertEqual($result, $expected); | |
610 | |
611 $result = $l10n->catalog(array('fr', 'fr-be', 'fr-ca', 'fr-ch', 'fr-fr', 'fr-lu')); | |
612 $expected = array( | |
613 'fr' => array('language' => 'French (Standard)', 'locale' => 'fre', 'localeFallback' => 'fre', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
614 'fr-be' => array('language' => 'French (Belgium)', 'locale' => 'fr_be', 'localeFallback' => 'fre', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
615 'fr-ca' => array('language' => 'French (Canadian)', 'locale' => 'fr_ca', 'localeFallback' => 'fre', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
616 'fr-ch' => array('language' => 'French (Swiss)', 'locale' => 'fr_ch', 'localeFallback' => 'fre', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
617 'fr-fr' => array('language' => 'French (France)', 'locale' => 'fr_fr', 'localeFallback' => 'fre', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
618 'fr-lu' => array('language' => 'French (Luxembourg)', 'locale' => 'fr_lu', 'localeFallback' => 'fre', 'charset' => 'utf-8', 'direction' => 'ltr') | |
619 ); | |
620 $this->assertEqual($result, $expected); | |
621 | |
622 $result = $l10n->catalog(array('ga')); | |
623 $expected = array( | |
624 'ga' => array('language' => 'Irish', 'locale' => 'gle', 'localeFallback' => 'gle', 'charset' => 'utf-8', 'direction' => 'ltr') | |
625 ); | |
626 $this->assertEqual($result, $expected); | |
627 | |
628 $result = $l10n->catalog(array('gd', 'gd-ie')); | |
629 $expected = array( | |
630 'gd' => array('language' => 'Gaelic (Scots)', 'locale' => 'gla', 'localeFallback' => 'gla', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
631 'gd-ie' => array('language' => 'Gaelic (Irish)', 'locale' => 'gd_ie', 'localeFallback' => 'gla', 'charset' => 'utf-8', 'direction' => 'ltr') | |
632 ); | |
633 $this->assertEqual($result, $expected); | |
634 | |
635 $result = $l10n->catalog(array('gl')); | |
636 $expected = array( | |
637 'gl' => array('language' => 'Galician', 'locale' => 'glg', 'localeFallback' => 'glg', 'charset' => 'utf-8', 'direction' => 'ltr') | |
638 ); | |
639 $this->assertEqual($result, $expected); | |
640 | |
641 $result = $l10n->catalog(array('he')); | |
642 $expected = array( | |
643 'he' => array('language' => 'Hebrew', 'locale' => 'heb', 'localeFallback' => 'heb', 'charset' => 'utf-8', 'direction' => 'rtl') | |
644 ); | |
645 $this->assertEqual($result, $expected); | |
646 | |
647 $result = $l10n->catalog(array('hi')); | |
648 $expected = array( | |
649 'hi' => array('language' => 'Hindi', 'locale' => 'hin', 'localeFallback' => 'hin', 'charset' => 'utf-8', 'direction' => 'ltr') | |
650 ); | |
651 $this->assertEqual($result, $expected); | |
652 | |
653 $result = $l10n->catalog(array('hr')); | |
654 $expected = array( | |
655 'hr' => array('language' => 'Croatian', 'locale' => 'hrv', 'localeFallback' => 'hrv', 'charset' => 'utf-8', 'direction' => 'ltr') | |
656 ); | |
657 $this->assertEqual($result, $expected); | |
658 | |
659 $result = $l10n->catalog(array('hu')); | |
660 $expected = array( | |
661 'hu' => array('language' => 'Hungarian', 'locale' => 'hun', 'localeFallback' => 'hun', 'charset' => 'utf-8', 'direction' => 'ltr') | |
662 ); | |
663 $this->assertEqual($result, $expected); | |
664 | |
665 $result = $l10n->catalog(array('hy')); | |
666 $expected = array( | |
667 'hy' => array('language' => 'Armenian - Armenia', 'locale' => 'hye', 'localeFallback' => 'hye', 'charset' => 'utf-8', 'direction' => 'ltr') | |
668 ); | |
669 $this->assertEqual($result, $expected); | |
670 | |
671 $result = $l10n->catalog(array('id', 'in')); | |
672 $expected = array( | |
673 'id' => array('language' => 'Indonesian', 'locale' => 'ind', 'localeFallback' => 'ind', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
674 'in' => array('language' => 'Indonesian', 'locale' => 'ind', 'localeFallback' => 'ind', 'charset' => 'utf-8', 'direction' => 'ltr') | |
675 ); | |
676 $this->assertEqual($result, $expected); | |
677 | |
678 $result = $l10n->catalog(array('is')); | |
679 $expected = array( | |
680 'is' => array('language' => 'Icelandic', 'locale' => 'ice', 'localeFallback' => 'ice', 'charset' => 'utf-8', 'direction' => 'ltr') | |
681 ); | |
682 $this->assertEqual($result, $expected); | |
683 | |
684 $result = $l10n->catalog(array('it', 'it-ch')); | |
685 $expected = array( | |
686 'it' => array('language' => 'Italian', 'locale' => 'ita', 'localeFallback' => 'ita', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
687 'it-ch' => array('language' => 'Italian (Swiss) ', 'locale' => 'it_ch', 'localeFallback' => 'ita', 'charset' => 'utf-8', 'direction' => 'ltr') | |
688 ); | |
689 $this->assertEqual($result, $expected); | |
690 | |
691 $result = $l10n->catalog(array('ja')); | |
692 $expected = array( | |
693 'ja' => array('language' => 'Japanese', 'locale' => 'jpn', 'localeFallback' => 'jpn', 'charset' => 'utf-8', 'direction' => 'ltr') | |
694 ); | |
695 $this->assertEqual($result, $expected); | |
696 | |
697 $result = $l10n->catalog(array('ko', 'ko-kp', 'ko-kr')); | |
698 $expected = array( | |
699 'ko' => array('language' => 'Korean', 'locale' => 'kor', 'localeFallback' => 'kor', 'charset' => 'kr', 'direction' => 'ltr'), | |
700 'ko-kp' => array('language' => 'Korea (North)', 'locale' => 'ko_kp', 'localeFallback' => 'kor', 'charset' => 'kr', 'direction' => 'ltr'), | |
701 'ko-kr' => array('language' => 'Korea (South)', 'locale' => 'ko_kr', 'localeFallback' => 'kor', 'charset' => 'kr', 'direction' => 'ltr') | |
702 ); | |
703 $this->assertEqual($result, $expected); | |
704 | |
705 $result = $l10n->catalog(array('koi8-r', 'ru', 'ru-mo')); | |
706 $expected = array( | |
707 'koi8-r' => array('language' => 'Russian', 'locale' => 'koi8_r', 'localeFallback' => 'rus', 'charset' => 'koi8-r', 'direction' => 'ltr'), | |
708 'ru' => array('language' => 'Russian', 'locale' => 'rus', 'localeFallback' => 'rus', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
709 'ru-mo' => array('language' => 'Russian (Moldavia)', 'locale' => 'ru_mo', 'localeFallback' => 'rus', 'charset' => 'utf-8', 'direction' => 'ltr') | |
710 ); | |
711 $this->assertEqual($result, $expected); | |
712 | |
713 $result = $l10n->catalog(array('lt')); | |
714 $expected = array( | |
715 'lt' => array('language' => 'Lithuanian', 'locale' => 'lit', 'localeFallback' => 'lit', 'charset' => 'utf-8', 'direction' => 'ltr') | |
716 ); | |
717 $this->assertEqual($result, $expected); | |
718 | |
719 $result = $l10n->catalog(array('lv')); | |
720 $expected = array( | |
721 'lv' => array('language' => 'Latvian', 'locale' => 'lav', 'localeFallback' => 'lav', 'charset' => 'utf-8', 'direction' => 'ltr') | |
722 ); | |
723 $this->assertEqual($result, $expected); | |
724 | |
725 $result = $l10n->catalog(array('mk', 'mk-mk')); | |
726 $expected = array( | |
727 'mk' => array('language' => 'FYRO Macedonian', 'locale' => 'mk', 'localeFallback' => 'mac', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
728 'mk-mk' => array('language' => 'Macedonian', 'locale' => 'mk_mk', 'localeFallback' => 'mac', 'charset' => 'utf-8', 'direction' => 'ltr') | |
729 ); | |
730 $this->assertEqual($result, $expected); | |
731 | |
732 $result = $l10n->catalog(array('ms')); | |
733 $expected = array( | |
734 'ms' => array('language' => 'Malaysian', 'locale' => 'may', 'localeFallback' => 'may', 'charset' => 'utf-8', 'direction' => 'ltr') | |
735 ); | |
736 $this->assertEqual($result, $expected); | |
737 | |
738 $result = $l10n->catalog(array('mt')); | |
739 $expected = array( | |
740 'mt' => array('language' => 'Maltese', 'locale' => 'mlt', 'localeFallback' => 'mlt', 'charset' => 'utf-8', 'direction' => 'ltr') | |
741 ); | |
742 $this->assertEqual($result, $expected); | |
743 | |
744 $result = $l10n->catalog(array('n', 'nl', 'nl-be')); | |
745 $expected = array( | |
746 'n' => array('language' => 'Dutch (Standard)', 'locale' => 'dut', 'localeFallback' => 'dut', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
747 'nl' => array('language' => 'Dutch (Standard)', 'locale' => 'dut', 'localeFallback' => 'dut', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
748 'nl-be' => array('language' => 'Dutch (Belgium)', 'locale' => 'nl_be', 'localeFallback' => 'dut', 'charset' => 'utf-8', 'direction' => 'ltr') | |
749 ); | |
750 $this->assertEqual($result, $expected); | |
751 | |
752 $result = $l10n->catalog('nl'); | |
753 $expected = array('language' => 'Dutch (Standard)', 'locale' => 'dut', 'localeFallback' => 'dut', 'charset' => 'utf-8', 'direction' => 'ltr'); | |
754 $this->assertEqual($result, $expected); | |
755 | |
756 $result = $l10n->catalog('nld'); | |
757 $expected = array('language' => 'Dutch (Standard)', 'locale' => 'dut', 'localeFallback' => 'dut', 'charset' => 'utf-8', 'direction' => 'ltr'); | |
758 $this->assertEqual($result, $expected); | |
759 | |
760 $result = $l10n->catalog('dut'); | |
761 $expected = array('language' => 'Dutch (Standard)', 'locale' => 'dut', 'localeFallback' => 'dut', 'charset' => 'utf-8', 'direction' => 'ltr'); | |
762 $this->assertEqual($result, $expected); | |
763 | |
764 $result = $l10n->catalog(array('nb')); | |
765 $expected = array( | |
766 'nb' => array('language' => 'Norwegian Bokmal', 'locale' => 'nob', 'localeFallback' => 'nor', 'charset' => 'utf-8', 'direction' => 'ltr') | |
767 ); | |
768 $this->assertEqual($result, $expected); | |
769 | |
770 $result = $l10n->catalog(array('nn', 'no')); | |
771 $expected = array( | |
772 'nn' => array('language' => 'Norwegian Nynorsk', 'locale' => 'nno', 'localeFallback' => 'nor', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
773 'no' => array('language' => 'Norwegian', 'locale' => 'nor', 'localeFallback' => 'nor', 'charset' => 'utf-8', 'direction' => 'ltr') | |
774 ); | |
775 $this->assertEqual($result, $expected); | |
776 | |
777 $result = $l10n->catalog(array('p', 'pl')); | |
778 $expected = array( | |
779 'p' => array('language' => 'Polish', 'locale' => 'pol', 'localeFallback' => 'pol', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
780 'pl' => array('language' => 'Polish', 'locale' => 'pol', 'localeFallback' => 'pol', 'charset' => 'utf-8', 'direction' => 'ltr') | |
781 ); | |
782 $this->assertEqual($result, $expected); | |
783 | |
784 $result = $l10n->catalog(array('pt', 'pt-br')); | |
785 $expected = array( | |
786 'pt' => array('language' => 'Portuguese (Portugal)', 'locale' => 'por', 'localeFallback' => 'por', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
787 'pt-br' => array('language' => 'Portuguese (Brazil)', 'locale' => 'pt_br', 'localeFallback' => 'por', 'charset' => 'utf-8', 'direction' => 'ltr') | |
788 ); | |
789 $this->assertEqual($result, $expected); | |
790 | |
791 $result = $l10n->catalog(array('rm')); | |
792 $expected = array( | |
793 'rm' => array('language' => 'Rhaeto-Romanic', 'locale' => 'roh', 'localeFallback' => 'roh', 'charset' => 'utf-8', 'direction' => 'ltr') | |
794 ); | |
795 $this->assertEqual($result, $expected); | |
796 | |
797 $result = $l10n->catalog(array('ro', 'ro-mo')); | |
798 $expected = array( | |
799 'ro' => array('language' => 'Romanian', 'locale' => 'rum', 'localeFallback' => 'rum', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
800 'ro-mo' => array('language' => 'Romanian (Moldavia)', 'locale' => 'ro_mo', 'localeFallback' => 'rum', 'charset' => 'utf-8', 'direction' => 'ltr') | |
801 ); | |
802 $this->assertEqual($result, $expected); | |
803 | |
804 $result = $l10n->catalog(array('sb')); | |
805 $expected = array( | |
806 'sb' => array('language' => 'Sorbian', 'locale' => 'wen', 'localeFallback' => 'wen', 'charset' => 'utf-8', 'direction' => 'ltr') | |
807 ); | |
808 $this->assertEqual($result, $expected); | |
809 | |
810 $result = $l10n->catalog(array('sk')); | |
811 $expected = array( | |
812 'sk' => array('language' => 'Slovak', 'locale' => 'slo', 'localeFallback' => 'slo', 'charset' => 'utf-8', 'direction' => 'ltr') | |
813 ); | |
814 $this->assertEqual($result, $expected); | |
815 | |
816 $result = $l10n->catalog(array('sl')); | |
817 $expected = array( | |
818 'sl' => array('language' => 'Slovenian', 'locale' => 'slv', 'localeFallback' => 'slv', 'charset' => 'utf-8', 'direction' => 'ltr') | |
819 ); | |
820 $this->assertEqual($result, $expected); | |
821 | |
822 $result = $l10n->catalog(array('sq')); | |
823 $expected = array( | |
824 'sq' => array('language' => 'Albanian', 'locale' => 'alb', 'localeFallback' => 'alb', 'charset' => 'utf-8', 'direction' => 'ltr') | |
825 ); | |
826 $this->assertEqual($result, $expected); | |
827 | |
828 $result = $l10n->catalog(array('sr')); | |
829 $expected = array( | |
830 'sr' => array('language' => 'Serbian', 'locale' => 'scc', 'localeFallback' => 'scc', 'charset' => 'utf-8', 'direction' => 'ltr') | |
831 ); | |
832 $this->assertEqual($result, $expected); | |
833 | |
834 $result = $l10n->catalog(array('sv', 'sv-fi')); | |
835 $expected = array( | |
836 'sv' => array('language' => 'Swedish', 'locale' => 'swe', 'localeFallback' => 'swe', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
837 'sv-fi' => array('language' => 'Swedish (Finland)', 'locale' => 'sv_fi', 'localeFallback' => 'swe', 'charset' => 'utf-8', 'direction' => 'ltr') | |
838 ); | |
839 $this->assertEqual($result, $expected); | |
840 | |
841 $result = $l10n->catalog(array('sx')); | |
842 $expected = array( | |
843 'sx' => array('language' => 'Sutu', 'locale' => 'sx', 'localeFallback' => 'sx', 'charset' => 'utf-8', 'direction' => 'ltr') | |
844 ); | |
845 $this->assertEqual($result, $expected); | |
846 | |
847 $result = $l10n->catalog(array('sz')); | |
848 $expected = array( | |
849 'sz' => array('language' => 'Sami (Lappish)', 'locale' => 'smi', 'localeFallback' => 'smi', 'charset' => 'utf-8', 'direction' => 'ltr') | |
850 ); | |
851 $this->assertEqual($result, $expected); | |
852 | |
853 $result = $l10n->catalog(array('th')); | |
854 $expected = array( | |
855 'th' => array('language' => 'Thai', 'locale' => 'tha', 'localeFallback' => 'tha', 'charset' => 'utf-8', 'direction' => 'ltr') | |
856 ); | |
857 $this->assertEqual($result, $expected); | |
858 | |
859 $result = $l10n->catalog(array('tn')); | |
860 $expected = array( | |
861 'tn' => array('language' => 'Tswana', 'locale' => 'tsn', 'localeFallback' => 'tsn', 'charset' => 'utf-8', 'direction' => 'ltr') | |
862 ); | |
863 $this->assertEqual($result, $expected); | |
864 | |
865 $result = $l10n->catalog(array('tr')); | |
866 $expected = array( | |
867 'tr' => array('language' => 'Turkish', 'locale' => 'tur', 'localeFallback' => 'tur', 'charset' => 'utf-8', 'direction' => 'ltr') | |
868 ); | |
869 $this->assertEqual($result, $expected); | |
870 | |
871 $result = $l10n->catalog(array('ts')); | |
872 $expected = array( | |
873 'ts' => array('language' => 'Tsonga', 'locale' => 'tso', 'localeFallback' => 'tso', 'charset' => 'utf-8', 'direction' => 'ltr') | |
874 ); | |
875 $this->assertEqual($result, $expected); | |
876 | |
877 $result = $l10n->catalog(array('uk')); | |
878 $expected = array( | |
879 'uk' => array('language' => 'Ukrainian', 'locale' => 'ukr', 'localeFallback' => 'ukr', 'charset' => 'utf-8', 'direction' => 'ltr') | |
880 ); | |
881 $this->assertEqual($result, $expected); | |
882 | |
883 $result = $l10n->catalog(array('ur')); | |
884 $expected = array( | |
885 'ur' => array('language' => 'Urdu', 'locale' => 'urd', 'localeFallback' => 'urd', 'charset' => 'utf-8', 'direction' => 'rtl') | |
886 ); | |
887 $this->assertEqual($result, $expected); | |
888 | |
889 $result = $l10n->catalog(array('ve')); | |
890 $expected = array( | |
891 've' => array('language' => 'Venda', 'locale' => 'ven', 'localeFallback' => 'ven', 'charset' => 'utf-8', 'direction' => 'ltr') | |
892 ); | |
893 $this->assertEqual($result, $expected); | |
894 | |
895 $result = $l10n->catalog(array('vi')); | |
896 $expected = array( | |
897 'vi' => array('language' => 'Vietnamese', 'locale' => 'vie', 'localeFallback' => 'vie', 'charset' => 'utf-8', 'direction' => 'ltr') | |
898 ); | |
899 $this->assertEqual($result, $expected); | |
900 | |
901 $result = $l10n->catalog(array('cy')); | |
902 $expected = array( | |
903 'cy' => array('language' => 'Welsh', 'locale' => 'cym', 'localeFallback' => 'cym', 'charset' => 'utf-8', | |
904 'direction' => 'ltr') | |
905 ); | |
906 $this->assertEqual($result, $expected); | |
907 | |
908 $result = $l10n->catalog(array('xh')); | |
909 $expected = array( | |
910 'xh' => array('language' => 'Xhosa', 'locale' => 'xho', 'localeFallback' => 'xho', 'charset' => 'utf-8', 'direction' => 'ltr') | |
911 ); | |
912 $this->assertEqual($result, $expected); | |
913 | |
914 $result = $l10n->catalog(array('yi')); | |
915 $expected = array( | |
916 'yi' => array('language' => 'Yiddish', 'locale' => 'yid', 'localeFallback' => 'yid', 'charset' => 'utf-8', 'direction' => 'ltr') | |
917 ); | |
918 $this->assertEqual($result, $expected); | |
919 | |
920 $result = $l10n->catalog(array('zh', 'zh-cn', 'zh-hk', 'zh-sg', 'zh-tw')); | |
921 $expected = array( | |
922 'zh' => array('language' => 'Chinese', 'locale' => 'chi', 'localeFallback' => 'chi', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
923 'zh-cn' => array('language' => 'Chinese (PRC)', 'locale' => 'zh_cn', 'localeFallback' => 'chi', 'charset' => 'GB2312', 'direction' => 'ltr'), | |
924 'zh-hk' => array('language' => 'Chinese (Hong Kong)', 'locale' => 'zh_hk', 'localeFallback' => 'chi', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
925 'zh-sg' => array('language' => 'Chinese (Singapore)', 'locale' => 'zh_sg', 'localeFallback' => 'chi', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
926 'zh-tw' => array('language' => 'Chinese (Taiwan)', 'locale' => 'zh_tw', 'localeFallback' => 'chi', 'charset' => 'utf-8', 'direction' => 'ltr') | |
927 ); | |
928 $this->assertEqual($result, $expected); | |
929 | |
930 $result = $l10n->catalog(array('zu')); | |
931 $expected = array( | |
932 'zu' => array('language' => 'Zulu', 'locale' => 'zul', 'localeFallback' => 'zul', 'charset' => 'utf-8', 'direction' => 'ltr') | |
933 ); | |
934 $this->assertEqual($result, $expected); | |
935 | |
936 $result = $l10n->catalog(array('en-nz', 'es-do', 'sz', 'ar-lb', 'zh-hk', 'pt-br')); | |
937 $expected = array( | |
938 'en-nz' => array('language' => 'English (New Zealand)', 'locale' => 'en_nz', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
939 'es-do' => array('language' => 'Spanish (Dominican Republic)', 'locale' => 'es_do', 'localeFallback' => 'spa', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
940 'sz' => array('language' => 'Sami (Lappish)', 'locale' => 'smi', 'localeFallback' => 'smi', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
941 'ar-lb' => array('language' => 'Arabic (Lebanon)', 'locale' => 'ar_lb', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'), | |
942 'zh-hk' => array('language' => 'Chinese (Hong Kong)', 'locale' => 'zh_hk', 'localeFallback' => 'chi', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
943 'pt-br' => array('language' => 'Portuguese (Brazil)', 'locale' => 'pt_br', 'localeFallback' => 'por', 'charset' => 'utf-8', 'direction' => 'ltr') | |
944 ); | |
945 $this->assertEqual($result, $expected); | |
946 | |
947 $result = $l10n->catalog(array('eng', 'deu', 'zho', 'rum', 'zul', 'yid')); | |
948 $expected = array( | |
949 'eng' => array('language' => 'English', 'locale' => 'eng', 'localeFallback' => 'eng', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
950 'deu' => array('language' => 'German (Standard)', 'locale' => 'deu', 'localeFallback' => 'deu', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
951 'zho' => array('language' => 'Chinese', 'locale' => 'chi', 'localeFallback' => 'chi', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
952 'rum' => array('language' => 'Romanian', 'locale' => 'rum', 'localeFallback' => 'rum', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
953 'zul' => array('language' => 'Zulu', 'locale' => 'zul', 'localeFallback' => 'zul', 'charset' => 'utf-8', 'direction' => 'ltr'), | |
954 'yid' => array('language' => 'Yiddish', 'locale' => 'yid', 'localeFallback' => 'yid', 'charset' => 'utf-8', 'direction' => 'ltr') | |
955 ); | |
956 $this->assertEqual($result, $expected); | |
957 } | |
958 } |