Mercurial > hg > Members > shoshi > webvirt
comparison cake/tests/cases/libs/i18n.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 * I18nTest 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', 'i18n'); | |
21 | |
22 /** | |
23 * I18nTest class | |
24 * | |
25 * @package cake | |
26 * @subpackage cake.tests.cases.libs | |
27 */ | |
28 class I18nTest extends CakeTestCase { | |
29 | |
30 /** | |
31 * setUp method | |
32 * | |
33 * @access public | |
34 * @return void | |
35 */ | |
36 function setUp() { | |
37 Cache::delete('object_map', '_cake_core_'); | |
38 App::build(array( | |
39 'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS), | |
40 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS) | |
41 ), true); | |
42 App::objects('plugin', null, false); | |
43 } | |
44 | |
45 /** | |
46 * tearDown method | |
47 * | |
48 * @access public | |
49 * @return void | |
50 */ | |
51 function tearDown() { | |
52 Cache::delete('object_map', '_cake_core_'); | |
53 App::build(); | |
54 App::objects('plugin', null, false); | |
55 } | |
56 | |
57 | |
58 function testTranslationCaching() { | |
59 Configure::write('Config.language', 'cache_test_po'); | |
60 $i18n =& i18n::getInstance(); | |
61 | |
62 // reset internally stored entries | |
63 I18n::clear(); | |
64 | |
65 Cache::clear(false, '_cake_core_'); | |
66 $lang = Configure::read('Config.language');#$i18n->l10n->locale; | |
67 | |
68 Cache::config('_cake_core_', Cache::config('default')); | |
69 | |
70 // make some calls to translate using different domains | |
71 $this->assertEqual(I18n::translate('dom1.foo', false, 'dom1'), 'Dom 1 Foo'); | |
72 $this->assertEqual(I18n::translate('dom1.bar', false, 'dom1'), 'Dom 1 Bar'); | |
73 $this->assertEqual($i18n->__domains['dom1']['cache_test_po']['LC_MESSAGES']['dom1.foo'], 'Dom 1 Foo'); | |
74 | |
75 // reset internally stored entries | |
76 I18n::clear(); | |
77 | |
78 // now only dom1 should be in cache | |
79 $cachedDom1 = Cache::read('dom1_' . $lang, '_cake_core_'); | |
80 $this->assertEqual($cachedDom1['LC_MESSAGES']['dom1.foo'], 'Dom 1 Foo'); | |
81 $this->assertEqual($cachedDom1['LC_MESSAGES']['dom1.bar'], 'Dom 1 Bar'); | |
82 // dom2 not in cache | |
83 $this->assertFalse(Cache::read('dom2_' . $lang, '_cake_core_')); | |
84 | |
85 // translate a item of dom2 (adds dom2 to cache) | |
86 $this->assertEqual(I18n::translate('dom2.foo', false, 'dom2'), 'Dom 2 Foo'); | |
87 | |
88 // verify dom2 was cached through manual read from cache | |
89 $cachedDom2 = Cache::read('dom2_' . $lang, '_cake_core_'); | |
90 $this->assertEqual($cachedDom2['LC_MESSAGES']['dom2.foo'], 'Dom 2 Foo'); | |
91 $this->assertEqual($cachedDom2['LC_MESSAGES']['dom2.bar'], 'Dom 2 Bar'); | |
92 | |
93 // modify cache entry manually to verify that dom1 entries now will be read from cache | |
94 $cachedDom1['LC_MESSAGES']['dom1.foo'] = 'FOO'; | |
95 Cache::write('dom1_' . $lang, $cachedDom1, '_cake_core_'); | |
96 $this->assertEqual(I18n::translate('dom1.foo', false, 'dom1'), 'FOO'); | |
97 } | |
98 | |
99 | |
100 /** | |
101 * testDefaultStrings method | |
102 * | |
103 * @access public | |
104 * @return void | |
105 */ | |
106 function testDefaultStrings() { | |
107 $singular = $this->__singular(); | |
108 $this->assertEqual('Plural Rule 1', $singular); | |
109 | |
110 $plurals = $this->__plural(); | |
111 $this->assertTrue(in_array('0 = 0 or > 1', $plurals)); | |
112 $this->assertTrue(in_array('1 = 1', $plurals)); | |
113 $this->assertTrue(in_array('2 = 0 or > 1', $plurals)); | |
114 $this->assertTrue(in_array('3 = 0 or > 1', $plurals)); | |
115 $this->assertTrue(in_array('4 = 0 or > 1', $plurals)); | |
116 $this->assertTrue(in_array('5 = 0 or > 1', $plurals)); | |
117 $this->assertTrue(in_array('6 = 0 or > 1', $plurals)); | |
118 $this->assertTrue(in_array('7 = 0 or > 1', $plurals)); | |
119 $this->assertTrue(in_array('8 = 0 or > 1', $plurals)); | |
120 $this->assertTrue(in_array('9 = 0 or > 1', $plurals)); | |
121 $this->assertTrue(in_array('10 = 0 or > 1', $plurals)); | |
122 $this->assertTrue(in_array('11 = 0 or > 1', $plurals)); | |
123 $this->assertTrue(in_array('12 = 0 or > 1', $plurals)); | |
124 $this->assertTrue(in_array('13 = 0 or > 1', $plurals)); | |
125 $this->assertTrue(in_array('14 = 0 or > 1', $plurals)); | |
126 $this->assertTrue(in_array('15 = 0 or > 1', $plurals)); | |
127 $this->assertTrue(in_array('16 = 0 or > 1', $plurals)); | |
128 $this->assertTrue(in_array('17 = 0 or > 1', $plurals)); | |
129 $this->assertTrue(in_array('18 = 0 or > 1', $plurals)); | |
130 $this->assertTrue(in_array('19 = 0 or > 1', $plurals)); | |
131 $this->assertTrue(in_array('20 = 0 or > 1', $plurals)); | |
132 $this->assertTrue(in_array('21 = 0 or > 1', $plurals)); | |
133 $this->assertTrue(in_array('22 = 0 or > 1', $plurals)); | |
134 $this->assertTrue(in_array('23 = 0 or > 1', $plurals)); | |
135 $this->assertTrue(in_array('24 = 0 or > 1', $plurals)); | |
136 $this->assertTrue(in_array('25 = 0 or > 1', $plurals)); | |
137 | |
138 $coreSingular = $this->__singularFromCore(); | |
139 $this->assertEqual('Plural Rule 1 (from core)', $coreSingular); | |
140 | |
141 $corePlurals = $this->__pluralFromCore(); | |
142 $this->assertTrue(in_array('0 = 0 or > 1 (from core)', $corePlurals)); | |
143 $this->assertTrue(in_array('1 = 1 (from core)', $corePlurals)); | |
144 $this->assertTrue(in_array('2 = 0 or > 1 (from core)', $corePlurals)); | |
145 $this->assertTrue(in_array('3 = 0 or > 1 (from core)', $corePlurals)); | |
146 $this->assertTrue(in_array('4 = 0 or > 1 (from core)', $corePlurals)); | |
147 $this->assertTrue(in_array('5 = 0 or > 1 (from core)', $corePlurals)); | |
148 $this->assertTrue(in_array('6 = 0 or > 1 (from core)', $corePlurals)); | |
149 $this->assertTrue(in_array('7 = 0 or > 1 (from core)', $corePlurals)); | |
150 $this->assertTrue(in_array('8 = 0 or > 1 (from core)', $corePlurals)); | |
151 $this->assertTrue(in_array('9 = 0 or > 1 (from core)', $corePlurals)); | |
152 $this->assertTrue(in_array('10 = 0 or > 1 (from core)', $corePlurals)); | |
153 $this->assertTrue(in_array('11 = 0 or > 1 (from core)', $corePlurals)); | |
154 $this->assertTrue(in_array('12 = 0 or > 1 (from core)', $corePlurals)); | |
155 $this->assertTrue(in_array('13 = 0 or > 1 (from core)', $corePlurals)); | |
156 $this->assertTrue(in_array('14 = 0 or > 1 (from core)', $corePlurals)); | |
157 $this->assertTrue(in_array('15 = 0 or > 1 (from core)', $corePlurals)); | |
158 $this->assertTrue(in_array('16 = 0 or > 1 (from core)', $corePlurals)); | |
159 $this->assertTrue(in_array('17 = 0 or > 1 (from core)', $corePlurals)); | |
160 $this->assertTrue(in_array('18 = 0 or > 1 (from core)', $corePlurals)); | |
161 $this->assertTrue(in_array('19 = 0 or > 1 (from core)', $corePlurals)); | |
162 $this->assertTrue(in_array('20 = 0 or > 1 (from core)', $corePlurals)); | |
163 $this->assertTrue(in_array('21 = 0 or > 1 (from core)', $corePlurals)); | |
164 $this->assertTrue(in_array('22 = 0 or > 1 (from core)', $corePlurals)); | |
165 $this->assertTrue(in_array('23 = 0 or > 1 (from core)', $corePlurals)); | |
166 $this->assertTrue(in_array('24 = 0 or > 1 (from core)', $corePlurals)); | |
167 $this->assertTrue(in_array('25 = 0 or > 1 (from core)', $corePlurals)); | |
168 } | |
169 | |
170 /** | |
171 * testPoRulesZero method | |
172 * | |
173 * @access public | |
174 * @return void | |
175 */ | |
176 function testPoRulesZero() { | |
177 Configure::write('Config.language', 'rule_0_po'); | |
178 | |
179 $singular = $this->__singular(); | |
180 $this->assertEqual('Plural Rule 0 (translated)', $singular); | |
181 | |
182 $plurals = $this->__plural(); | |
183 $this->assertTrue(in_array('0 ends with any # (translated)', $plurals)); | |
184 $this->assertTrue(in_array('1 ends with any # (translated)', $plurals)); | |
185 $this->assertTrue(in_array('2 ends with any # (translated)', $plurals)); | |
186 $this->assertTrue(in_array('3 ends with any # (translated)', $plurals)); | |
187 $this->assertTrue(in_array('4 ends with any # (translated)', $plurals)); | |
188 $this->assertTrue(in_array('5 ends with any # (translated)', $plurals)); | |
189 $this->assertTrue(in_array('6 ends with any # (translated)', $plurals)); | |
190 $this->assertTrue(in_array('7 ends with any # (translated)', $plurals)); | |
191 $this->assertTrue(in_array('8 ends with any # (translated)', $plurals)); | |
192 $this->assertTrue(in_array('9 ends with any # (translated)', $plurals)); | |
193 $this->assertTrue(in_array('10 ends with any # (translated)', $plurals)); | |
194 $this->assertTrue(in_array('11 ends with any # (translated)', $plurals)); | |
195 $this->assertTrue(in_array('12 ends with any # (translated)', $plurals)); | |
196 $this->assertTrue(in_array('13 ends with any # (translated)', $plurals)); | |
197 $this->assertTrue(in_array('14 ends with any # (translated)', $plurals)); | |
198 $this->assertTrue(in_array('15 ends with any # (translated)', $plurals)); | |
199 $this->assertTrue(in_array('16 ends with any # (translated)', $plurals)); | |
200 $this->assertTrue(in_array('17 ends with any # (translated)', $plurals)); | |
201 $this->assertTrue(in_array('18 ends with any # (translated)', $plurals)); | |
202 $this->assertTrue(in_array('19 ends with any # (translated)', $plurals)); | |
203 $this->assertTrue(in_array('20 ends with any # (translated)', $plurals)); | |
204 $this->assertTrue(in_array('21 ends with any # (translated)', $plurals)); | |
205 $this->assertTrue(in_array('22 ends with any # (translated)', $plurals)); | |
206 $this->assertTrue(in_array('23 ends with any # (translated)', $plurals)); | |
207 $this->assertTrue(in_array('24 ends with any # (translated)', $plurals)); | |
208 $this->assertTrue(in_array('25 ends with any # (translated)', $plurals)); | |
209 | |
210 $coreSingular = $this->__singularFromCore(); | |
211 $this->assertEqual('Plural Rule 0 (from core translated)', $coreSingular); | |
212 | |
213 $corePlurals = $this->__pluralFromCore(); | |
214 $this->assertTrue(in_array('0 ends with any # (from core translated)', $corePlurals)); | |
215 $this->assertTrue(in_array('1 ends with any # (from core translated)', $corePlurals)); | |
216 $this->assertTrue(in_array('2 ends with any # (from core translated)', $corePlurals)); | |
217 $this->assertTrue(in_array('3 ends with any # (from core translated)', $corePlurals)); | |
218 $this->assertTrue(in_array('4 ends with any # (from core translated)', $corePlurals)); | |
219 $this->assertTrue(in_array('5 ends with any # (from core translated)', $corePlurals)); | |
220 $this->assertTrue(in_array('6 ends with any # (from core translated)', $corePlurals)); | |
221 $this->assertTrue(in_array('7 ends with any # (from core translated)', $corePlurals)); | |
222 $this->assertTrue(in_array('8 ends with any # (from core translated)', $corePlurals)); | |
223 $this->assertTrue(in_array('9 ends with any # (from core translated)', $corePlurals)); | |
224 $this->assertTrue(in_array('10 ends with any # (from core translated)', $corePlurals)); | |
225 $this->assertTrue(in_array('11 ends with any # (from core translated)', $corePlurals)); | |
226 $this->assertTrue(in_array('12 ends with any # (from core translated)', $corePlurals)); | |
227 $this->assertTrue(in_array('13 ends with any # (from core translated)', $corePlurals)); | |
228 $this->assertTrue(in_array('14 ends with any # (from core translated)', $corePlurals)); | |
229 $this->assertTrue(in_array('15 ends with any # (from core translated)', $corePlurals)); | |
230 $this->assertTrue(in_array('16 ends with any # (from core translated)', $corePlurals)); | |
231 $this->assertTrue(in_array('17 ends with any # (from core translated)', $corePlurals)); | |
232 $this->assertTrue(in_array('18 ends with any # (from core translated)', $corePlurals)); | |
233 $this->assertTrue(in_array('19 ends with any # (from core translated)', $corePlurals)); | |
234 $this->assertTrue(in_array('20 ends with any # (from core translated)', $corePlurals)); | |
235 $this->assertTrue(in_array('21 ends with any # (from core translated)', $corePlurals)); | |
236 $this->assertTrue(in_array('22 ends with any # (from core translated)', $corePlurals)); | |
237 $this->assertTrue(in_array('23 ends with any # (from core translated)', $corePlurals)); | |
238 $this->assertTrue(in_array('24 ends with any # (from core translated)', $corePlurals)); | |
239 $this->assertTrue(in_array('25 ends with any # (from core translated)', $corePlurals)); | |
240 } | |
241 | |
242 /** | |
243 * testMoRulesZero method | |
244 * | |
245 * @access public | |
246 * @return void | |
247 */ | |
248 function testMoRulesZero() { | |
249 Configure::write('Config.language', 'rule_0_mo'); | |
250 | |
251 $singular = $this->__singular(); | |
252 $this->assertEqual('Plural Rule 0 (translated)', $singular); | |
253 | |
254 $plurals = $this->__plural(); | |
255 $this->assertTrue(in_array('0 ends with any # (translated)', $plurals)); | |
256 $this->assertTrue(in_array('1 ends with any # (translated)', $plurals)); | |
257 $this->assertTrue(in_array('2 ends with any # (translated)', $plurals)); | |
258 $this->assertTrue(in_array('3 ends with any # (translated)', $plurals)); | |
259 $this->assertTrue(in_array('4 ends with any # (translated)', $plurals)); | |
260 $this->assertTrue(in_array('5 ends with any # (translated)', $plurals)); | |
261 $this->assertTrue(in_array('6 ends with any # (translated)', $plurals)); | |
262 $this->assertTrue(in_array('7 ends with any # (translated)', $plurals)); | |
263 $this->assertTrue(in_array('8 ends with any # (translated)', $plurals)); | |
264 $this->assertTrue(in_array('9 ends with any # (translated)', $plurals)); | |
265 $this->assertTrue(in_array('10 ends with any # (translated)', $plurals)); | |
266 $this->assertTrue(in_array('11 ends with any # (translated)', $plurals)); | |
267 $this->assertTrue(in_array('12 ends with any # (translated)', $plurals)); | |
268 $this->assertTrue(in_array('13 ends with any # (translated)', $plurals)); | |
269 $this->assertTrue(in_array('14 ends with any # (translated)', $plurals)); | |
270 $this->assertTrue(in_array('15 ends with any # (translated)', $plurals)); | |
271 $this->assertTrue(in_array('16 ends with any # (translated)', $plurals)); | |
272 $this->assertTrue(in_array('17 ends with any # (translated)', $plurals)); | |
273 $this->assertTrue(in_array('18 ends with any # (translated)', $plurals)); | |
274 $this->assertTrue(in_array('19 ends with any # (translated)', $plurals)); | |
275 $this->assertTrue(in_array('20 ends with any # (translated)', $plurals)); | |
276 $this->assertTrue(in_array('21 ends with any # (translated)', $plurals)); | |
277 $this->assertTrue(in_array('22 ends with any # (translated)', $plurals)); | |
278 $this->assertTrue(in_array('23 ends with any # (translated)', $plurals)); | |
279 $this->assertTrue(in_array('24 ends with any # (translated)', $plurals)); | |
280 $this->assertTrue(in_array('25 ends with any # (translated)', $plurals)); | |
281 | |
282 $coreSingular = $this->__singularFromCore(); | |
283 $this->assertEqual('Plural Rule 0 (from core translated)', $coreSingular); | |
284 | |
285 $corePlurals = $this->__pluralFromCore(); | |
286 $this->assertTrue(in_array('0 ends with any # (from core translated)', $corePlurals)); | |
287 $this->assertTrue(in_array('1 ends with any # (from core translated)', $corePlurals)); | |
288 $this->assertTrue(in_array('2 ends with any # (from core translated)', $corePlurals)); | |
289 $this->assertTrue(in_array('3 ends with any # (from core translated)', $corePlurals)); | |
290 $this->assertTrue(in_array('4 ends with any # (from core translated)', $corePlurals)); | |
291 $this->assertTrue(in_array('5 ends with any # (from core translated)', $corePlurals)); | |
292 $this->assertTrue(in_array('6 ends with any # (from core translated)', $corePlurals)); | |
293 $this->assertTrue(in_array('7 ends with any # (from core translated)', $corePlurals)); | |
294 $this->assertTrue(in_array('8 ends with any # (from core translated)', $corePlurals)); | |
295 $this->assertTrue(in_array('9 ends with any # (from core translated)', $corePlurals)); | |
296 $this->assertTrue(in_array('10 ends with any # (from core translated)', $corePlurals)); | |
297 $this->assertTrue(in_array('11 ends with any # (from core translated)', $corePlurals)); | |
298 $this->assertTrue(in_array('12 ends with any # (from core translated)', $corePlurals)); | |
299 $this->assertTrue(in_array('13 ends with any # (from core translated)', $corePlurals)); | |
300 $this->assertTrue(in_array('14 ends with any # (from core translated)', $corePlurals)); | |
301 $this->assertTrue(in_array('15 ends with any # (from core translated)', $corePlurals)); | |
302 $this->assertTrue(in_array('16 ends with any # (from core translated)', $corePlurals)); | |
303 $this->assertTrue(in_array('17 ends with any # (from core translated)', $corePlurals)); | |
304 $this->assertTrue(in_array('18 ends with any # (from core translated)', $corePlurals)); | |
305 $this->assertTrue(in_array('19 ends with any # (from core translated)', $corePlurals)); | |
306 $this->assertTrue(in_array('20 ends with any # (from core translated)', $corePlurals)); | |
307 $this->assertTrue(in_array('21 ends with any # (from core translated)', $corePlurals)); | |
308 $this->assertTrue(in_array('22 ends with any # (from core translated)', $corePlurals)); | |
309 $this->assertTrue(in_array('23 ends with any # (from core translated)', $corePlurals)); | |
310 $this->assertTrue(in_array('24 ends with any # (from core translated)', $corePlurals)); | |
311 $this->assertTrue(in_array('25 ends with any # (from core translated)', $corePlurals)); | |
312 } | |
313 | |
314 /** | |
315 * testPoRulesOne method | |
316 * | |
317 * @access public | |
318 * @return void | |
319 */ | |
320 function testPoRulesOne() { | |
321 Configure::write('Config.language', 'rule_1_po'); | |
322 | |
323 $singular = $this->__singular(); | |
324 $this->assertEqual('Plural Rule 1 (translated)', $singular); | |
325 | |
326 $plurals = $this->__plural(); | |
327 $this->assertTrue(in_array('0 = 0 or > 1 (translated)', $plurals)); | |
328 $this->assertTrue(in_array('1 = 1 (translated)', $plurals)); | |
329 $this->assertTrue(in_array('2 = 0 or > 1 (translated)', $plurals)); | |
330 $this->assertTrue(in_array('3 = 0 or > 1 (translated)', $plurals)); | |
331 $this->assertTrue(in_array('4 = 0 or > 1 (translated)', $plurals)); | |
332 $this->assertTrue(in_array('5 = 0 or > 1 (translated)', $plurals)); | |
333 $this->assertTrue(in_array('6 = 0 or > 1 (translated)', $plurals)); | |
334 $this->assertTrue(in_array('7 = 0 or > 1 (translated)', $plurals)); | |
335 $this->assertTrue(in_array('8 = 0 or > 1 (translated)', $plurals)); | |
336 $this->assertTrue(in_array('9 = 0 or > 1 (translated)', $plurals)); | |
337 $this->assertTrue(in_array('10 = 0 or > 1 (translated)', $plurals)); | |
338 $this->assertTrue(in_array('11 = 0 or > 1 (translated)', $plurals)); | |
339 $this->assertTrue(in_array('12 = 0 or > 1 (translated)', $plurals)); | |
340 $this->assertTrue(in_array('13 = 0 or > 1 (translated)', $plurals)); | |
341 $this->assertTrue(in_array('14 = 0 or > 1 (translated)', $plurals)); | |
342 $this->assertTrue(in_array('15 = 0 or > 1 (translated)', $plurals)); | |
343 $this->assertTrue(in_array('16 = 0 or > 1 (translated)', $plurals)); | |
344 $this->assertTrue(in_array('17 = 0 or > 1 (translated)', $plurals)); | |
345 $this->assertTrue(in_array('18 = 0 or > 1 (translated)', $plurals)); | |
346 $this->assertTrue(in_array('19 = 0 or > 1 (translated)', $plurals)); | |
347 $this->assertTrue(in_array('20 = 0 or > 1 (translated)', $plurals)); | |
348 $this->assertTrue(in_array('21 = 0 or > 1 (translated)', $plurals)); | |
349 $this->assertTrue(in_array('22 = 0 or > 1 (translated)', $plurals)); | |
350 $this->assertTrue(in_array('23 = 0 or > 1 (translated)', $plurals)); | |
351 $this->assertTrue(in_array('24 = 0 or > 1 (translated)', $plurals)); | |
352 $this->assertTrue(in_array('25 = 0 or > 1 (translated)', $plurals)); | |
353 | |
354 $coreSingular = $this->__singularFromCore(); | |
355 $this->assertEqual('Plural Rule 1 (from core translated)', $coreSingular); | |
356 | |
357 $corePlurals = $this->__pluralFromCore(); | |
358 $this->assertTrue(in_array('0 = 0 or > 1 (from core translated)', $corePlurals)); | |
359 $this->assertTrue(in_array('1 = 1 (from core translated)', $corePlurals)); | |
360 $this->assertTrue(in_array('2 = 0 or > 1 (from core translated)', $corePlurals)); | |
361 $this->assertTrue(in_array('3 = 0 or > 1 (from core translated)', $corePlurals)); | |
362 $this->assertTrue(in_array('4 = 0 or > 1 (from core translated)', $corePlurals)); | |
363 $this->assertTrue(in_array('5 = 0 or > 1 (from core translated)', $corePlurals)); | |
364 $this->assertTrue(in_array('6 = 0 or > 1 (from core translated)', $corePlurals)); | |
365 $this->assertTrue(in_array('7 = 0 or > 1 (from core translated)', $corePlurals)); | |
366 $this->assertTrue(in_array('8 = 0 or > 1 (from core translated)', $corePlurals)); | |
367 $this->assertTrue(in_array('9 = 0 or > 1 (from core translated)', $corePlurals)); | |
368 $this->assertTrue(in_array('10 = 0 or > 1 (from core translated)', $corePlurals)); | |
369 $this->assertTrue(in_array('11 = 0 or > 1 (from core translated)', $corePlurals)); | |
370 $this->assertTrue(in_array('12 = 0 or > 1 (from core translated)', $corePlurals)); | |
371 $this->assertTrue(in_array('13 = 0 or > 1 (from core translated)', $corePlurals)); | |
372 $this->assertTrue(in_array('14 = 0 or > 1 (from core translated)', $corePlurals)); | |
373 $this->assertTrue(in_array('15 = 0 or > 1 (from core translated)', $corePlurals)); | |
374 $this->assertTrue(in_array('16 = 0 or > 1 (from core translated)', $corePlurals)); | |
375 $this->assertTrue(in_array('17 = 0 or > 1 (from core translated)', $corePlurals)); | |
376 $this->assertTrue(in_array('18 = 0 or > 1 (from core translated)', $corePlurals)); | |
377 $this->assertTrue(in_array('19 = 0 or > 1 (from core translated)', $corePlurals)); | |
378 $this->assertTrue(in_array('20 = 0 or > 1 (from core translated)', $corePlurals)); | |
379 $this->assertTrue(in_array('21 = 0 or > 1 (from core translated)', $corePlurals)); | |
380 $this->assertTrue(in_array('22 = 0 or > 1 (from core translated)', $corePlurals)); | |
381 $this->assertTrue(in_array('23 = 0 or > 1 (from core translated)', $corePlurals)); | |
382 $this->assertTrue(in_array('24 = 0 or > 1 (from core translated)', $corePlurals)); | |
383 $this->assertTrue(in_array('25 = 0 or > 1 (from core translated)', $corePlurals)); | |
384 } | |
385 | |
386 /** | |
387 * testMoRulesOne method | |
388 * | |
389 * @access public | |
390 * @return void | |
391 */ | |
392 function testMoRulesOne() { | |
393 Configure::write('Config.language', 'rule_1_mo'); | |
394 | |
395 $singular = $this->__singular(); | |
396 $this->assertEqual('Plural Rule 1 (translated)', $singular); | |
397 | |
398 $plurals = $this->__plural(); | |
399 $this->assertTrue(in_array('0 = 0 or > 1 (translated)', $plurals)); | |
400 $this->assertTrue(in_array('1 = 1 (translated)', $plurals)); | |
401 $this->assertTrue(in_array('2 = 0 or > 1 (translated)', $plurals)); | |
402 $this->assertTrue(in_array('3 = 0 or > 1 (translated)', $plurals)); | |
403 $this->assertTrue(in_array('4 = 0 or > 1 (translated)', $plurals)); | |
404 $this->assertTrue(in_array('5 = 0 or > 1 (translated)', $plurals)); | |
405 $this->assertTrue(in_array('6 = 0 or > 1 (translated)', $plurals)); | |
406 $this->assertTrue(in_array('7 = 0 or > 1 (translated)', $plurals)); | |
407 $this->assertTrue(in_array('8 = 0 or > 1 (translated)', $plurals)); | |
408 $this->assertTrue(in_array('9 = 0 or > 1 (translated)', $plurals)); | |
409 $this->assertTrue(in_array('10 = 0 or > 1 (translated)', $plurals)); | |
410 $this->assertTrue(in_array('11 = 0 or > 1 (translated)', $plurals)); | |
411 $this->assertTrue(in_array('12 = 0 or > 1 (translated)', $plurals)); | |
412 $this->assertTrue(in_array('13 = 0 or > 1 (translated)', $plurals)); | |
413 $this->assertTrue(in_array('14 = 0 or > 1 (translated)', $plurals)); | |
414 $this->assertTrue(in_array('15 = 0 or > 1 (translated)', $plurals)); | |
415 $this->assertTrue(in_array('16 = 0 or > 1 (translated)', $plurals)); | |
416 $this->assertTrue(in_array('17 = 0 or > 1 (translated)', $plurals)); | |
417 $this->assertTrue(in_array('18 = 0 or > 1 (translated)', $plurals)); | |
418 $this->assertTrue(in_array('19 = 0 or > 1 (translated)', $plurals)); | |
419 $this->assertTrue(in_array('20 = 0 or > 1 (translated)', $plurals)); | |
420 $this->assertTrue(in_array('21 = 0 or > 1 (translated)', $plurals)); | |
421 $this->assertTrue(in_array('22 = 0 or > 1 (translated)', $plurals)); | |
422 $this->assertTrue(in_array('23 = 0 or > 1 (translated)', $plurals)); | |
423 $this->assertTrue(in_array('24 = 0 or > 1 (translated)', $plurals)); | |
424 $this->assertTrue(in_array('25 = 0 or > 1 (translated)', $plurals)); | |
425 | |
426 $coreSingular = $this->__singularFromCore(); | |
427 $this->assertEqual('Plural Rule 1 (from core translated)', $coreSingular); | |
428 | |
429 $corePlurals = $this->__pluralFromCore(); | |
430 $this->assertTrue(in_array('0 = 0 or > 1 (from core translated)', $corePlurals)); | |
431 $this->assertTrue(in_array('1 = 1 (from core translated)', $corePlurals)); | |
432 $this->assertTrue(in_array('2 = 0 or > 1 (from core translated)', $corePlurals)); | |
433 $this->assertTrue(in_array('3 = 0 or > 1 (from core translated)', $corePlurals)); | |
434 $this->assertTrue(in_array('4 = 0 or > 1 (from core translated)', $corePlurals)); | |
435 $this->assertTrue(in_array('5 = 0 or > 1 (from core translated)', $corePlurals)); | |
436 $this->assertTrue(in_array('6 = 0 or > 1 (from core translated)', $corePlurals)); | |
437 $this->assertTrue(in_array('7 = 0 or > 1 (from core translated)', $corePlurals)); | |
438 $this->assertTrue(in_array('8 = 0 or > 1 (from core translated)', $corePlurals)); | |
439 $this->assertTrue(in_array('9 = 0 or > 1 (from core translated)', $corePlurals)); | |
440 $this->assertTrue(in_array('10 = 0 or > 1 (from core translated)', $corePlurals)); | |
441 $this->assertTrue(in_array('11 = 0 or > 1 (from core translated)', $corePlurals)); | |
442 $this->assertTrue(in_array('12 = 0 or > 1 (from core translated)', $corePlurals)); | |
443 $this->assertTrue(in_array('13 = 0 or > 1 (from core translated)', $corePlurals)); | |
444 $this->assertTrue(in_array('14 = 0 or > 1 (from core translated)', $corePlurals)); | |
445 $this->assertTrue(in_array('15 = 0 or > 1 (from core translated)', $corePlurals)); | |
446 $this->assertTrue(in_array('16 = 0 or > 1 (from core translated)', $corePlurals)); | |
447 $this->assertTrue(in_array('17 = 0 or > 1 (from core translated)', $corePlurals)); | |
448 $this->assertTrue(in_array('18 = 0 or > 1 (from core translated)', $corePlurals)); | |
449 $this->assertTrue(in_array('19 = 0 or > 1 (from core translated)', $corePlurals)); | |
450 $this->assertTrue(in_array('20 = 0 or > 1 (from core translated)', $corePlurals)); | |
451 $this->assertTrue(in_array('21 = 0 or > 1 (from core translated)', $corePlurals)); | |
452 $this->assertTrue(in_array('22 = 0 or > 1 (from core translated)', $corePlurals)); | |
453 $this->assertTrue(in_array('23 = 0 or > 1 (from core translated)', $corePlurals)); | |
454 $this->assertTrue(in_array('24 = 0 or > 1 (from core translated)', $corePlurals)); | |
455 $this->assertTrue(in_array('25 = 0 or > 1 (from core translated)', $corePlurals)); | |
456 } | |
457 | |
458 /** | |
459 * testPoRulesTwo method | |
460 * | |
461 * @access public | |
462 * @return void | |
463 */ | |
464 function testPoRulesTwo() { | |
465 Configure::write('Config.language', 'rule_2_po'); | |
466 | |
467 $singular = $this->__singular(); | |
468 $this->assertEqual('Plural Rule 2 (translated)', $singular); | |
469 | |
470 $plurals = $this->__plural(); | |
471 $this->assertTrue(in_array('0 = 0 or 1 (translated)', $plurals)); | |
472 $this->assertTrue(in_array('1 = 0 or 1 (translated)', $plurals)); | |
473 $this->assertTrue(in_array('2 > 1 (translated)', $plurals)); | |
474 $this->assertTrue(in_array('3 > 1 (translated)', $plurals)); | |
475 $this->assertTrue(in_array('4 > 1 (translated)', $plurals)); | |
476 $this->assertTrue(in_array('5 > 1 (translated)', $plurals)); | |
477 $this->assertTrue(in_array('6 > 1 (translated)', $plurals)); | |
478 $this->assertTrue(in_array('7 > 1 (translated)', $plurals)); | |
479 $this->assertTrue(in_array('8 > 1 (translated)', $plurals)); | |
480 $this->assertTrue(in_array('9 > 1 (translated)', $plurals)); | |
481 $this->assertTrue(in_array('10 > 1 (translated)', $plurals)); | |
482 $this->assertTrue(in_array('11 > 1 (translated)', $plurals)); | |
483 $this->assertTrue(in_array('12 > 1 (translated)', $plurals)); | |
484 $this->assertTrue(in_array('13 > 1 (translated)', $plurals)); | |
485 $this->assertTrue(in_array('14 > 1 (translated)', $plurals)); | |
486 $this->assertTrue(in_array('15 > 1 (translated)', $plurals)); | |
487 $this->assertTrue(in_array('16 > 1 (translated)', $plurals)); | |
488 $this->assertTrue(in_array('17 > 1 (translated)', $plurals)); | |
489 $this->assertTrue(in_array('18 > 1 (translated)', $plurals)); | |
490 $this->assertTrue(in_array('19 > 1 (translated)', $plurals)); | |
491 $this->assertTrue(in_array('20 > 1 (translated)', $plurals)); | |
492 $this->assertTrue(in_array('21 > 1 (translated)', $plurals)); | |
493 $this->assertTrue(in_array('22 > 1 (translated)', $plurals)); | |
494 $this->assertTrue(in_array('23 > 1 (translated)', $plurals)); | |
495 $this->assertTrue(in_array('24 > 1 (translated)', $plurals)); | |
496 $this->assertTrue(in_array('25 > 1 (translated)', $plurals)); | |
497 | |
498 $coreSingular = $this->__singularFromCore(); | |
499 $this->assertEqual('Plural Rule 2 (from core translated)', $coreSingular); | |
500 | |
501 $corePlurals = $this->__pluralFromCore(); | |
502 $this->assertTrue(in_array('0 = 0 or 1 (from core translated)', $corePlurals)); | |
503 $this->assertTrue(in_array('1 = 0 or 1 (from core translated)', $corePlurals)); | |
504 $this->assertTrue(in_array('2 > 1 (from core translated)', $corePlurals)); | |
505 $this->assertTrue(in_array('3 > 1 (from core translated)', $corePlurals)); | |
506 $this->assertTrue(in_array('4 > 1 (from core translated)', $corePlurals)); | |
507 $this->assertTrue(in_array('5 > 1 (from core translated)', $corePlurals)); | |
508 $this->assertTrue(in_array('6 > 1 (from core translated)', $corePlurals)); | |
509 $this->assertTrue(in_array('7 > 1 (from core translated)', $corePlurals)); | |
510 $this->assertTrue(in_array('8 > 1 (from core translated)', $corePlurals)); | |
511 $this->assertTrue(in_array('9 > 1 (from core translated)', $corePlurals)); | |
512 $this->assertTrue(in_array('10 > 1 (from core translated)', $corePlurals)); | |
513 $this->assertTrue(in_array('11 > 1 (from core translated)', $corePlurals)); | |
514 $this->assertTrue(in_array('12 > 1 (from core translated)', $corePlurals)); | |
515 $this->assertTrue(in_array('13 > 1 (from core translated)', $corePlurals)); | |
516 $this->assertTrue(in_array('14 > 1 (from core translated)', $corePlurals)); | |
517 $this->assertTrue(in_array('15 > 1 (from core translated)', $corePlurals)); | |
518 $this->assertTrue(in_array('16 > 1 (from core translated)', $corePlurals)); | |
519 $this->assertTrue(in_array('17 > 1 (from core translated)', $corePlurals)); | |
520 $this->assertTrue(in_array('18 > 1 (from core translated)', $corePlurals)); | |
521 $this->assertTrue(in_array('19 > 1 (from core translated)', $corePlurals)); | |
522 $this->assertTrue(in_array('20 > 1 (from core translated)', $corePlurals)); | |
523 $this->assertTrue(in_array('21 > 1 (from core translated)', $corePlurals)); | |
524 $this->assertTrue(in_array('22 > 1 (from core translated)', $corePlurals)); | |
525 $this->assertTrue(in_array('23 > 1 (from core translated)', $corePlurals)); | |
526 $this->assertTrue(in_array('24 > 1 (from core translated)', $corePlurals)); | |
527 $this->assertTrue(in_array('25 > 1 (from core translated)', $corePlurals)); | |
528 } | |
529 | |
530 /** | |
531 * testMoRulesTwo method | |
532 * | |
533 * @access public | |
534 * @return void | |
535 */ | |
536 function testMoRulesTwo() { | |
537 Configure::write('Config.language', 'rule_2_mo'); | |
538 | |
539 $singular = $this->__singular(); | |
540 $this->assertEqual('Plural Rule 2 (translated)', $singular); | |
541 | |
542 $plurals = $this->__plural(); | |
543 $this->assertTrue(in_array('0 = 0 or 1 (translated)', $plurals)); | |
544 $this->assertTrue(in_array('1 = 0 or 1 (translated)', $plurals)); | |
545 $this->assertTrue(in_array('2 > 1 (translated)', $plurals)); | |
546 $this->assertTrue(in_array('3 > 1 (translated)', $plurals)); | |
547 $this->assertTrue(in_array('4 > 1 (translated)', $plurals)); | |
548 $this->assertTrue(in_array('5 > 1 (translated)', $plurals)); | |
549 $this->assertTrue(in_array('6 > 1 (translated)', $plurals)); | |
550 $this->assertTrue(in_array('7 > 1 (translated)', $plurals)); | |
551 $this->assertTrue(in_array('8 > 1 (translated)', $plurals)); | |
552 $this->assertTrue(in_array('9 > 1 (translated)', $plurals)); | |
553 $this->assertTrue(in_array('10 > 1 (translated)', $plurals)); | |
554 $this->assertTrue(in_array('11 > 1 (translated)', $plurals)); | |
555 $this->assertTrue(in_array('12 > 1 (translated)', $plurals)); | |
556 $this->assertTrue(in_array('13 > 1 (translated)', $plurals)); | |
557 $this->assertTrue(in_array('14 > 1 (translated)', $plurals)); | |
558 $this->assertTrue(in_array('15 > 1 (translated)', $plurals)); | |
559 $this->assertTrue(in_array('16 > 1 (translated)', $plurals)); | |
560 $this->assertTrue(in_array('17 > 1 (translated)', $plurals)); | |
561 $this->assertTrue(in_array('18 > 1 (translated)', $plurals)); | |
562 $this->assertTrue(in_array('19 > 1 (translated)', $plurals)); | |
563 $this->assertTrue(in_array('20 > 1 (translated)', $plurals)); | |
564 $this->assertTrue(in_array('21 > 1 (translated)', $plurals)); | |
565 $this->assertTrue(in_array('22 > 1 (translated)', $plurals)); | |
566 $this->assertTrue(in_array('23 > 1 (translated)', $plurals)); | |
567 $this->assertTrue(in_array('24 > 1 (translated)', $plurals)); | |
568 $this->assertTrue(in_array('25 > 1 (translated)', $plurals)); | |
569 | |
570 $coreSingular = $this->__singularFromCore(); | |
571 $this->assertEqual('Plural Rule 2 (from core translated)', $coreSingular); | |
572 | |
573 $corePlurals = $this->__pluralFromCore(); | |
574 $this->assertTrue(in_array('0 = 0 or 1 (from core translated)', $corePlurals)); | |
575 $this->assertTrue(in_array('1 = 0 or 1 (from core translated)', $corePlurals)); | |
576 $this->assertTrue(in_array('2 > 1 (from core translated)', $corePlurals)); | |
577 $this->assertTrue(in_array('3 > 1 (from core translated)', $corePlurals)); | |
578 $this->assertTrue(in_array('4 > 1 (from core translated)', $corePlurals)); | |
579 $this->assertTrue(in_array('5 > 1 (from core translated)', $corePlurals)); | |
580 $this->assertTrue(in_array('6 > 1 (from core translated)', $corePlurals)); | |
581 $this->assertTrue(in_array('7 > 1 (from core translated)', $corePlurals)); | |
582 $this->assertTrue(in_array('8 > 1 (from core translated)', $corePlurals)); | |
583 $this->assertTrue(in_array('9 > 1 (from core translated)', $corePlurals)); | |
584 $this->assertTrue(in_array('10 > 1 (from core translated)', $corePlurals)); | |
585 $this->assertTrue(in_array('11 > 1 (from core translated)', $corePlurals)); | |
586 $this->assertTrue(in_array('12 > 1 (from core translated)', $corePlurals)); | |
587 $this->assertTrue(in_array('13 > 1 (from core translated)', $corePlurals)); | |
588 $this->assertTrue(in_array('14 > 1 (from core translated)', $corePlurals)); | |
589 $this->assertTrue(in_array('15 > 1 (from core translated)', $corePlurals)); | |
590 $this->assertTrue(in_array('16 > 1 (from core translated)', $corePlurals)); | |
591 $this->assertTrue(in_array('17 > 1 (from core translated)', $corePlurals)); | |
592 $this->assertTrue(in_array('18 > 1 (from core translated)', $corePlurals)); | |
593 $this->assertTrue(in_array('19 > 1 (from core translated)', $corePlurals)); | |
594 $this->assertTrue(in_array('20 > 1 (from core translated)', $corePlurals)); | |
595 $this->assertTrue(in_array('21 > 1 (from core translated)', $corePlurals)); | |
596 $this->assertTrue(in_array('22 > 1 (from core translated)', $corePlurals)); | |
597 $this->assertTrue(in_array('23 > 1 (from core translated)', $corePlurals)); | |
598 $this->assertTrue(in_array('24 > 1 (from core translated)', $corePlurals)); | |
599 $this->assertTrue(in_array('25 > 1 (from core translated)', $corePlurals)); | |
600 } | |
601 | |
602 /** | |
603 * testPoRulesThree method | |
604 * | |
605 * @access public | |
606 * @return void | |
607 */ | |
608 function testPoRulesThree() { | |
609 Configure::write('Config.language', 'rule_3_po'); | |
610 | |
611 $singular = $this->__singular(); | |
612 $this->assertEqual('Plural Rule 3 (translated)', $singular); | |
613 | |
614 $plurals = $this->__plural(); | |
615 $this->assertTrue(in_array('0 = 0 (translated)', $plurals)); | |
616 $this->assertTrue(in_array('1 ends 1 but not 11 (translated)', $plurals)); | |
617 $this->assertTrue(in_array('2 everything else (translated)', $plurals)); | |
618 $this->assertTrue(in_array('3 everything else (translated)', $plurals)); | |
619 $this->assertTrue(in_array('4 everything else (translated)', $plurals)); | |
620 $this->assertTrue(in_array('5 everything else (translated)', $plurals)); | |
621 $this->assertTrue(in_array('6 everything else (translated)', $plurals)); | |
622 $this->assertTrue(in_array('7 everything else (translated)', $plurals)); | |
623 $this->assertTrue(in_array('8 everything else (translated)', $plurals)); | |
624 $this->assertTrue(in_array('9 everything else (translated)', $plurals)); | |
625 $this->assertTrue(in_array('10 everything else (translated)', $plurals)); | |
626 $this->assertTrue(in_array('11 everything else (translated)', $plurals)); | |
627 $this->assertTrue(in_array('12 everything else (translated)', $plurals)); | |
628 $this->assertTrue(in_array('13 everything else (translated)', $plurals)); | |
629 $this->assertTrue(in_array('14 everything else (translated)', $plurals)); | |
630 $this->assertTrue(in_array('15 everything else (translated)', $plurals)); | |
631 $this->assertTrue(in_array('16 everything else (translated)', $plurals)); | |
632 $this->assertTrue(in_array('17 everything else (translated)', $plurals)); | |
633 $this->assertTrue(in_array('18 everything else (translated)', $plurals)); | |
634 $this->assertTrue(in_array('19 everything else (translated)', $plurals)); | |
635 $this->assertTrue(in_array('20 everything else (translated)', $plurals)); | |
636 $this->assertTrue(in_array('21 ends 1 but not 11 (translated)', $plurals)); | |
637 $this->assertTrue(in_array('22 everything else (translated)', $plurals)); | |
638 $this->assertTrue(in_array('23 everything else (translated)', $plurals)); | |
639 $this->assertTrue(in_array('24 everything else (translated)', $plurals)); | |
640 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
641 | |
642 $coreSingular = $this->__singularFromCore(); | |
643 $this->assertEqual('Plural Rule 3 (from core translated)', $coreSingular); | |
644 | |
645 $corePlurals = $this->__pluralFromCore(); | |
646 $this->assertTrue(in_array('0 = 0 (from core translated)', $corePlurals)); | |
647 $this->assertTrue(in_array('1 ends 1 but not 11 (from core translated)', $corePlurals)); | |
648 $this->assertTrue(in_array('2 everything else (from core translated)', $corePlurals)); | |
649 $this->assertTrue(in_array('3 everything else (from core translated)', $corePlurals)); | |
650 $this->assertTrue(in_array('4 everything else (from core translated)', $corePlurals)); | |
651 $this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals)); | |
652 $this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals)); | |
653 $this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals)); | |
654 $this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals)); | |
655 $this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals)); | |
656 $this->assertTrue(in_array('10 everything else (from core translated)', $corePlurals)); | |
657 $this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals)); | |
658 $this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals)); | |
659 $this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals)); | |
660 $this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals)); | |
661 $this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals)); | |
662 $this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals)); | |
663 $this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals)); | |
664 $this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals)); | |
665 $this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals)); | |
666 $this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals)); | |
667 $this->assertTrue(in_array('21 ends 1 but not 11 (from core translated)', $corePlurals)); | |
668 $this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals)); | |
669 $this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals)); | |
670 $this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals)); | |
671 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
672 } | |
673 | |
674 /** | |
675 * testMoRulesThree method | |
676 * | |
677 * @access public | |
678 * @return void | |
679 */ | |
680 function testMoRulesThree() { | |
681 Configure::write('Config.language', 'rule_3_mo'); | |
682 | |
683 $singular = $this->__singular(); | |
684 $this->assertEqual('Plural Rule 3 (translated)', $singular); | |
685 | |
686 $plurals = $this->__plural(); | |
687 $this->assertTrue(in_array('0 = 0 (translated)', $plurals)); | |
688 $this->assertTrue(in_array('1 ends 1 but not 11 (translated)', $plurals)); | |
689 $this->assertTrue(in_array('2 everything else (translated)', $plurals)); | |
690 $this->assertTrue(in_array('3 everything else (translated)', $plurals)); | |
691 $this->assertTrue(in_array('4 everything else (translated)', $plurals)); | |
692 $this->assertTrue(in_array('5 everything else (translated)', $plurals)); | |
693 $this->assertTrue(in_array('6 everything else (translated)', $plurals)); | |
694 $this->assertTrue(in_array('7 everything else (translated)', $plurals)); | |
695 $this->assertTrue(in_array('8 everything else (translated)', $plurals)); | |
696 $this->assertTrue(in_array('9 everything else (translated)', $plurals)); | |
697 $this->assertTrue(in_array('10 everything else (translated)', $plurals)); | |
698 $this->assertTrue(in_array('11 everything else (translated)', $plurals)); | |
699 $this->assertTrue(in_array('12 everything else (translated)', $plurals)); | |
700 $this->assertTrue(in_array('13 everything else (translated)', $plurals)); | |
701 $this->assertTrue(in_array('14 everything else (translated)', $plurals)); | |
702 $this->assertTrue(in_array('15 everything else (translated)', $plurals)); | |
703 $this->assertTrue(in_array('16 everything else (translated)', $plurals)); | |
704 $this->assertTrue(in_array('17 everything else (translated)', $plurals)); | |
705 $this->assertTrue(in_array('18 everything else (translated)', $plurals)); | |
706 $this->assertTrue(in_array('19 everything else (translated)', $plurals)); | |
707 $this->assertTrue(in_array('20 everything else (translated)', $plurals)); | |
708 $this->assertTrue(in_array('21 ends 1 but not 11 (translated)', $plurals)); | |
709 $this->assertTrue(in_array('22 everything else (translated)', $plurals)); | |
710 $this->assertTrue(in_array('23 everything else (translated)', $plurals)); | |
711 $this->assertTrue(in_array('24 everything else (translated)', $plurals)); | |
712 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
713 | |
714 $coreSingular = $this->__singularFromCore(); | |
715 $this->assertEqual('Plural Rule 3 (from core translated)', $coreSingular); | |
716 | |
717 $corePlurals = $this->__pluralFromCore(); | |
718 $this->assertTrue(in_array('0 = 0 (from core translated)', $corePlurals)); | |
719 $this->assertTrue(in_array('1 ends 1 but not 11 (from core translated)', $corePlurals)); | |
720 $this->assertTrue(in_array('2 everything else (from core translated)', $corePlurals)); | |
721 $this->assertTrue(in_array('3 everything else (from core translated)', $corePlurals)); | |
722 $this->assertTrue(in_array('4 everything else (from core translated)', $corePlurals)); | |
723 $this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals)); | |
724 $this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals)); | |
725 $this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals)); | |
726 $this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals)); | |
727 $this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals)); | |
728 $this->assertTrue(in_array('10 everything else (from core translated)', $corePlurals)); | |
729 $this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals)); | |
730 $this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals)); | |
731 $this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals)); | |
732 $this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals)); | |
733 $this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals)); | |
734 $this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals)); | |
735 $this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals)); | |
736 $this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals)); | |
737 $this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals)); | |
738 $this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals)); | |
739 $this->assertTrue(in_array('21 ends 1 but not 11 (from core translated)', $corePlurals)); | |
740 $this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals)); | |
741 $this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals)); | |
742 $this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals)); | |
743 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
744 } | |
745 | |
746 /** | |
747 * testPoRulesFour method | |
748 * | |
749 * @access public | |
750 * @return void | |
751 */ | |
752 function testPoRulesFour() { | |
753 Configure::write('Config.language', 'rule_4_po'); | |
754 | |
755 $singular = $this->__singular(); | |
756 $this->assertEqual('Plural Rule 4 (translated)', $singular); | |
757 | |
758 $plurals = $this->__plural(); | |
759 $this->assertTrue(in_array('0 everything else (translated)', $plurals)); | |
760 $this->assertTrue(in_array('1 = 1 (translated)', $plurals)); | |
761 $this->assertTrue(in_array('2 = 2 (translated)', $plurals)); | |
762 $this->assertTrue(in_array('3 everything else (translated)', $plurals)); | |
763 $this->assertTrue(in_array('4 everything else (translated)', $plurals)); | |
764 $this->assertTrue(in_array('5 everything else (translated)', $plurals)); | |
765 $this->assertTrue(in_array('6 everything else (translated)', $plurals)); | |
766 $this->assertTrue(in_array('7 everything else (translated)', $plurals)); | |
767 $this->assertTrue(in_array('8 everything else (translated)', $plurals)); | |
768 $this->assertTrue(in_array('9 everything else (translated)', $plurals)); | |
769 $this->assertTrue(in_array('10 everything else (translated)', $plurals)); | |
770 $this->assertTrue(in_array('11 everything else (translated)', $plurals)); | |
771 $this->assertTrue(in_array('12 everything else (translated)', $plurals)); | |
772 $this->assertTrue(in_array('13 everything else (translated)', $plurals)); | |
773 $this->assertTrue(in_array('14 everything else (translated)', $plurals)); | |
774 $this->assertTrue(in_array('15 everything else (translated)', $plurals)); | |
775 $this->assertTrue(in_array('16 everything else (translated)', $plurals)); | |
776 $this->assertTrue(in_array('17 everything else (translated)', $plurals)); | |
777 $this->assertTrue(in_array('18 everything else (translated)', $plurals)); | |
778 $this->assertTrue(in_array('19 everything else (translated)', $plurals)); | |
779 $this->assertTrue(in_array('20 everything else (translated)', $plurals)); | |
780 $this->assertTrue(in_array('21 everything else (translated)', $plurals)); | |
781 $this->assertTrue(in_array('22 everything else (translated)', $plurals)); | |
782 $this->assertTrue(in_array('23 everything else (translated)', $plurals)); | |
783 $this->assertTrue(in_array('24 everything else (translated)', $plurals)); | |
784 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
785 | |
786 $coreSingular = $this->__singularFromCore(); | |
787 $this->assertEqual('Plural Rule 4 (from core translated)', $coreSingular); | |
788 | |
789 $corePlurals = $this->__pluralFromCore(); | |
790 $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); | |
791 $this->assertTrue(in_array('1 = 1 (from core translated)', $corePlurals)); | |
792 $this->assertTrue(in_array('2 = 2 (from core translated)', $corePlurals)); | |
793 $this->assertTrue(in_array('3 everything else (from core translated)', $corePlurals)); | |
794 $this->assertTrue(in_array('4 everything else (from core translated)', $corePlurals)); | |
795 $this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals)); | |
796 $this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals)); | |
797 $this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals)); | |
798 $this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals)); | |
799 $this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals)); | |
800 $this->assertTrue(in_array('10 everything else (from core translated)', $corePlurals)); | |
801 $this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals)); | |
802 $this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals)); | |
803 $this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals)); | |
804 $this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals)); | |
805 $this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals)); | |
806 $this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals)); | |
807 $this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals)); | |
808 $this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals)); | |
809 $this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals)); | |
810 $this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals)); | |
811 $this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals)); | |
812 $this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals)); | |
813 $this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals)); | |
814 $this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals)); | |
815 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
816 } | |
817 | |
818 /** | |
819 * testMoRulesFour method | |
820 * | |
821 * @access public | |
822 * @return void | |
823 */ | |
824 function testMoRulesFour() { | |
825 Configure::write('Config.language', 'rule_4_mo'); | |
826 | |
827 $singular = $this->__singular(); | |
828 $this->assertEqual('Plural Rule 4 (translated)', $singular); | |
829 | |
830 $plurals = $this->__plural(); | |
831 $this->assertTrue(in_array('0 everything else (translated)', $plurals)); | |
832 $this->assertTrue(in_array('1 = 1 (translated)', $plurals)); | |
833 $this->assertTrue(in_array('2 = 2 (translated)', $plurals)); | |
834 $this->assertTrue(in_array('3 everything else (translated)', $plurals)); | |
835 $this->assertTrue(in_array('4 everything else (translated)', $plurals)); | |
836 $this->assertTrue(in_array('5 everything else (translated)', $plurals)); | |
837 $this->assertTrue(in_array('6 everything else (translated)', $plurals)); | |
838 $this->assertTrue(in_array('7 everything else (translated)', $plurals)); | |
839 $this->assertTrue(in_array('8 everything else (translated)', $plurals)); | |
840 $this->assertTrue(in_array('9 everything else (translated)', $plurals)); | |
841 $this->assertTrue(in_array('10 everything else (translated)', $plurals)); | |
842 $this->assertTrue(in_array('11 everything else (translated)', $plurals)); | |
843 $this->assertTrue(in_array('12 everything else (translated)', $plurals)); | |
844 $this->assertTrue(in_array('13 everything else (translated)', $plurals)); | |
845 $this->assertTrue(in_array('14 everything else (translated)', $plurals)); | |
846 $this->assertTrue(in_array('15 everything else (translated)', $plurals)); | |
847 $this->assertTrue(in_array('16 everything else (translated)', $plurals)); | |
848 $this->assertTrue(in_array('17 everything else (translated)', $plurals)); | |
849 $this->assertTrue(in_array('18 everything else (translated)', $plurals)); | |
850 $this->assertTrue(in_array('19 everything else (translated)', $plurals)); | |
851 $this->assertTrue(in_array('20 everything else (translated)', $plurals)); | |
852 $this->assertTrue(in_array('21 everything else (translated)', $plurals)); | |
853 $this->assertTrue(in_array('22 everything else (translated)', $plurals)); | |
854 $this->assertTrue(in_array('23 everything else (translated)', $plurals)); | |
855 $this->assertTrue(in_array('24 everything else (translated)', $plurals)); | |
856 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
857 | |
858 $coreSingular = $this->__singularFromCore(); | |
859 $this->assertEqual('Plural Rule 4 (from core translated)', $coreSingular); | |
860 | |
861 $corePlurals = $this->__pluralFromCore(); | |
862 $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); | |
863 $this->assertTrue(in_array('1 = 1 (from core translated)', $corePlurals)); | |
864 $this->assertTrue(in_array('2 = 2 (from core translated)', $corePlurals)); | |
865 $this->assertTrue(in_array('3 everything else (from core translated)', $corePlurals)); | |
866 $this->assertTrue(in_array('4 everything else (from core translated)', $corePlurals)); | |
867 $this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals)); | |
868 $this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals)); | |
869 $this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals)); | |
870 $this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals)); | |
871 $this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals)); | |
872 $this->assertTrue(in_array('10 everything else (from core translated)', $corePlurals)); | |
873 $this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals)); | |
874 $this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals)); | |
875 $this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals)); | |
876 $this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals)); | |
877 $this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals)); | |
878 $this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals)); | |
879 $this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals)); | |
880 $this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals)); | |
881 $this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals)); | |
882 $this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals)); | |
883 $this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals)); | |
884 $this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals)); | |
885 $this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals)); | |
886 $this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals)); | |
887 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
888 } | |
889 | |
890 /** | |
891 * testPoRulesFive method | |
892 * | |
893 * @access public | |
894 * @return void | |
895 */ | |
896 function testPoRulesFive() { | |
897 Configure::write('Config.language', 'rule_5_po'); | |
898 | |
899 $singular = $this->__singular(); | |
900 $this->assertEqual('Plural Rule 5 (translated)', $singular); | |
901 | |
902 $plurals = $this->__plural(); | |
903 $this->assertTrue(in_array('0 = 0 or ends in 01-19 (translated)', $plurals)); | |
904 $this->assertTrue(in_array('0 = 0 or ends in 01-19 (translated)', $plurals)); | |
905 $this->assertTrue(in_array('1 = 1 (translated)', $plurals)); | |
906 $this->assertTrue(in_array('2 = 0 or ends in 01-19 (translated)', $plurals)); | |
907 $this->assertTrue(in_array('3 = 0 or ends in 01-19 (translated)', $plurals)); | |
908 $this->assertTrue(in_array('4 = 0 or ends in 01-19 (translated)', $plurals)); | |
909 $this->assertTrue(in_array('5 = 0 or ends in 01-19 (translated)', $plurals)); | |
910 $this->assertTrue(in_array('6 = 0 or ends in 01-19 (translated)', $plurals)); | |
911 $this->assertTrue(in_array('7 = 0 or ends in 01-19 (translated)', $plurals)); | |
912 $this->assertTrue(in_array('8 = 0 or ends in 01-19 (translated)', $plurals)); | |
913 $this->assertTrue(in_array('9 = 0 or ends in 01-19 (translated)', $plurals)); | |
914 $this->assertTrue(in_array('10 = 0 or ends in 01-19 (translated)', $plurals)); | |
915 $this->assertTrue(in_array('11 = 0 or ends in 01-19 (translated)', $plurals)); | |
916 $this->assertTrue(in_array('12 = 0 or ends in 01-19 (translated)', $plurals)); | |
917 $this->assertTrue(in_array('13 = 0 or ends in 01-19 (translated)', $plurals)); | |
918 $this->assertTrue(in_array('14 = 0 or ends in 01-19 (translated)', $plurals)); | |
919 $this->assertTrue(in_array('15 = 0 or ends in 01-19 (translated)', $plurals)); | |
920 $this->assertTrue(in_array('16 = 0 or ends in 01-19 (translated)', $plurals)); | |
921 $this->assertTrue(in_array('17 = 0 or ends in 01-19 (translated)', $plurals)); | |
922 $this->assertTrue(in_array('18 = 0 or ends in 01-19 (translated)', $plurals)); | |
923 $this->assertTrue(in_array('19 = 0 or ends in 01-19 (translated)', $plurals)); | |
924 $this->assertTrue(in_array('20 everything else (translated)', $plurals)); | |
925 $this->assertTrue(in_array('21 everything else (translated)', $plurals)); | |
926 $this->assertTrue(in_array('22 everything else (translated)', $plurals)); | |
927 $this->assertTrue(in_array('23 everything else (translated)', $plurals)); | |
928 $this->assertTrue(in_array('24 everything else (translated)', $plurals)); | |
929 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
930 | |
931 $coreSingular = $this->__singularFromCore(); | |
932 $this->assertEqual('Plural Rule 5 (from core translated)', $coreSingular); | |
933 | |
934 $corePlurals = $this->__pluralFromCore(); | |
935 $this->assertTrue(in_array('0 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
936 $this->assertTrue(in_array('0 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
937 $this->assertTrue(in_array('1 = 1 (from core translated)', $corePlurals)); | |
938 $this->assertTrue(in_array('2 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
939 $this->assertTrue(in_array('3 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
940 $this->assertTrue(in_array('4 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
941 $this->assertTrue(in_array('5 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
942 $this->assertTrue(in_array('6 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
943 $this->assertTrue(in_array('7 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
944 $this->assertTrue(in_array('8 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
945 $this->assertTrue(in_array('9 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
946 $this->assertTrue(in_array('10 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
947 $this->assertTrue(in_array('11 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
948 $this->assertTrue(in_array('12 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
949 $this->assertTrue(in_array('13 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
950 $this->assertTrue(in_array('14 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
951 $this->assertTrue(in_array('15 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
952 $this->assertTrue(in_array('16 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
953 $this->assertTrue(in_array('17 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
954 $this->assertTrue(in_array('18 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
955 $this->assertTrue(in_array('19 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
956 $this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals)); | |
957 $this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals)); | |
958 $this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals)); | |
959 $this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals)); | |
960 $this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals)); | |
961 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
962 } | |
963 | |
964 /** | |
965 * testMoRulesFive method | |
966 * | |
967 * @access public | |
968 * @return void | |
969 */ | |
970 function testMoRulesFive() { | |
971 Configure::write('Config.language', 'rule_5_mo'); | |
972 | |
973 $singular = $this->__singular(); | |
974 $this->assertEqual('Plural Rule 5 (translated)', $singular); | |
975 | |
976 $plurals = $this->__plural(); | |
977 $this->assertTrue(in_array('0 = 0 or ends in 01-19 (translated)', $plurals)); | |
978 $this->assertTrue(in_array('0 = 0 or ends in 01-19 (translated)', $plurals)); | |
979 $this->assertTrue(in_array('1 = 1 (translated)', $plurals)); | |
980 $this->assertTrue(in_array('2 = 0 or ends in 01-19 (translated)', $plurals)); | |
981 $this->assertTrue(in_array('3 = 0 or ends in 01-19 (translated)', $plurals)); | |
982 $this->assertTrue(in_array('4 = 0 or ends in 01-19 (translated)', $plurals)); | |
983 $this->assertTrue(in_array('5 = 0 or ends in 01-19 (translated)', $plurals)); | |
984 $this->assertTrue(in_array('6 = 0 or ends in 01-19 (translated)', $plurals)); | |
985 $this->assertTrue(in_array('7 = 0 or ends in 01-19 (translated)', $plurals)); | |
986 $this->assertTrue(in_array('8 = 0 or ends in 01-19 (translated)', $plurals)); | |
987 $this->assertTrue(in_array('9 = 0 or ends in 01-19 (translated)', $plurals)); | |
988 $this->assertTrue(in_array('10 = 0 or ends in 01-19 (translated)', $plurals)); | |
989 $this->assertTrue(in_array('11 = 0 or ends in 01-19 (translated)', $plurals)); | |
990 $this->assertTrue(in_array('12 = 0 or ends in 01-19 (translated)', $plurals)); | |
991 $this->assertTrue(in_array('13 = 0 or ends in 01-19 (translated)', $plurals)); | |
992 $this->assertTrue(in_array('14 = 0 or ends in 01-19 (translated)', $plurals)); | |
993 $this->assertTrue(in_array('15 = 0 or ends in 01-19 (translated)', $plurals)); | |
994 $this->assertTrue(in_array('16 = 0 or ends in 01-19 (translated)', $plurals)); | |
995 $this->assertTrue(in_array('17 = 0 or ends in 01-19 (translated)', $plurals)); | |
996 $this->assertTrue(in_array('18 = 0 or ends in 01-19 (translated)', $plurals)); | |
997 $this->assertTrue(in_array('19 = 0 or ends in 01-19 (translated)', $plurals)); | |
998 $this->assertTrue(in_array('20 everything else (translated)', $plurals)); | |
999 $this->assertTrue(in_array('21 everything else (translated)', $plurals)); | |
1000 $this->assertTrue(in_array('22 everything else (translated)', $plurals)); | |
1001 $this->assertTrue(in_array('23 everything else (translated)', $plurals)); | |
1002 $this->assertTrue(in_array('24 everything else (translated)', $plurals)); | |
1003 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
1004 | |
1005 $coreSingular = $this->__singularFromCore(); | |
1006 $this->assertEqual('Plural Rule 5 (from core translated)', $coreSingular); | |
1007 | |
1008 $corePlurals = $this->__pluralFromCore(); | |
1009 $this->assertTrue(in_array('0 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
1010 $this->assertTrue(in_array('0 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
1011 $this->assertTrue(in_array('1 = 1 (from core translated)', $corePlurals)); | |
1012 $this->assertTrue(in_array('2 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
1013 $this->assertTrue(in_array('3 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
1014 $this->assertTrue(in_array('4 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
1015 $this->assertTrue(in_array('5 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
1016 $this->assertTrue(in_array('6 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
1017 $this->assertTrue(in_array('7 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
1018 $this->assertTrue(in_array('8 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
1019 $this->assertTrue(in_array('9 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
1020 $this->assertTrue(in_array('10 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
1021 $this->assertTrue(in_array('11 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
1022 $this->assertTrue(in_array('12 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
1023 $this->assertTrue(in_array('13 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
1024 $this->assertTrue(in_array('14 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
1025 $this->assertTrue(in_array('15 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
1026 $this->assertTrue(in_array('16 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
1027 $this->assertTrue(in_array('17 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
1028 $this->assertTrue(in_array('18 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
1029 $this->assertTrue(in_array('19 = 0 or ends in 01-19 (from core translated)', $corePlurals)); | |
1030 $this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals)); | |
1031 $this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals)); | |
1032 $this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals)); | |
1033 $this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals)); | |
1034 $this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals)); | |
1035 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
1036 } | |
1037 | |
1038 /** | |
1039 * testPoRulesSix method | |
1040 * | |
1041 * @access public | |
1042 * @return void | |
1043 */ | |
1044 function testPoRulesSix() { | |
1045 Configure::write('Config.language', 'rule_6_po'); | |
1046 | |
1047 $singular = $this->__singular(); | |
1048 $this->assertEqual('Plural Rule 6 (translated)', $singular); | |
1049 | |
1050 $plurals = $this->__plural(); | |
1051 $this->assertTrue(in_array('0 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1052 $this->assertTrue(in_array('1 ends in 1, not 11 (translated)', $plurals)); | |
1053 $this->assertTrue(in_array('2 everything else (translated)', $plurals)); | |
1054 $this->assertTrue(in_array('3 everything else (translated)', $plurals)); | |
1055 $this->assertTrue(in_array('4 everything else (translated)', $plurals)); | |
1056 $this->assertTrue(in_array('5 everything else (translated)', $plurals)); | |
1057 $this->assertTrue(in_array('6 everything else (translated)', $plurals)); | |
1058 $this->assertTrue(in_array('7 everything else (translated)', $plurals)); | |
1059 $this->assertTrue(in_array('8 everything else (translated)', $plurals)); | |
1060 $this->assertTrue(in_array('9 everything else (translated)', $plurals)); | |
1061 $this->assertTrue(in_array('10 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1062 $this->assertTrue(in_array('11 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1063 $this->assertTrue(in_array('12 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1064 $this->assertTrue(in_array('13 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1065 $this->assertTrue(in_array('14 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1066 $this->assertTrue(in_array('15 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1067 $this->assertTrue(in_array('16 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1068 $this->assertTrue(in_array('17 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1069 $this->assertTrue(in_array('18 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1070 $this->assertTrue(in_array('19 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1071 $this->assertTrue(in_array('20 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1072 $this->assertTrue(in_array('21 ends in 1, not 11 (translated)', $plurals)); | |
1073 $this->assertTrue(in_array('22 everything else (translated)', $plurals)); | |
1074 $this->assertTrue(in_array('23 everything else (translated)', $plurals)); | |
1075 $this->assertTrue(in_array('24 everything else (translated)', $plurals)); | |
1076 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
1077 | |
1078 $coreSingular = $this->__singularFromCore(); | |
1079 $this->assertEqual('Plural Rule 6 (from core translated)', $coreSingular); | |
1080 | |
1081 $corePlurals = $this->__pluralFromCore(); | |
1082 $this->assertTrue(in_array('0 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1083 $this->assertTrue(in_array('1 ends in 1, not 11 (from core translated)', $corePlurals)); | |
1084 $this->assertTrue(in_array('2 everything else (from core translated)', $corePlurals)); | |
1085 $this->assertTrue(in_array('3 everything else (from core translated)', $corePlurals)); | |
1086 $this->assertTrue(in_array('4 everything else (from core translated)', $corePlurals)); | |
1087 $this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals)); | |
1088 $this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals)); | |
1089 $this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals)); | |
1090 $this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals)); | |
1091 $this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals)); | |
1092 $this->assertTrue(in_array('10 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1093 $this->assertTrue(in_array('11 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1094 $this->assertTrue(in_array('12 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1095 $this->assertTrue(in_array('13 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1096 $this->assertTrue(in_array('14 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1097 $this->assertTrue(in_array('15 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1098 $this->assertTrue(in_array('16 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1099 $this->assertTrue(in_array('17 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1100 $this->assertTrue(in_array('18 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1101 $this->assertTrue(in_array('19 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1102 $this->assertTrue(in_array('20 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1103 $this->assertTrue(in_array('21 ends in 1, not 11 (from core translated)', $corePlurals)); | |
1104 $this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals)); | |
1105 $this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals)); | |
1106 $this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals)); | |
1107 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
1108 } | |
1109 | |
1110 /** | |
1111 * testMoRulesSix method | |
1112 * | |
1113 * @access public | |
1114 * @return void | |
1115 */ | |
1116 function testMoRulesSix() { | |
1117 Configure::write('Config.language', 'rule_6_mo'); | |
1118 | |
1119 $singular = $this->__singular(); | |
1120 $this->assertEqual('Plural Rule 6 (translated)', $singular); | |
1121 | |
1122 $plurals = $this->__plural(); | |
1123 $this->assertTrue(in_array('0 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1124 $this->assertTrue(in_array('1 ends in 1, not 11 (translated)', $plurals)); | |
1125 $this->assertTrue(in_array('2 everything else (translated)', $plurals)); | |
1126 $this->assertTrue(in_array('3 everything else (translated)', $plurals)); | |
1127 $this->assertTrue(in_array('4 everything else (translated)', $plurals)); | |
1128 $this->assertTrue(in_array('5 everything else (translated)', $plurals)); | |
1129 $this->assertTrue(in_array('6 everything else (translated)', $plurals)); | |
1130 $this->assertTrue(in_array('7 everything else (translated)', $plurals)); | |
1131 $this->assertTrue(in_array('8 everything else (translated)', $plurals)); | |
1132 $this->assertTrue(in_array('9 everything else (translated)', $plurals)); | |
1133 $this->assertTrue(in_array('10 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1134 $this->assertTrue(in_array('11 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1135 $this->assertTrue(in_array('12 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1136 $this->assertTrue(in_array('13 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1137 $this->assertTrue(in_array('14 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1138 $this->assertTrue(in_array('15 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1139 $this->assertTrue(in_array('16 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1140 $this->assertTrue(in_array('17 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1141 $this->assertTrue(in_array('18 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1142 $this->assertTrue(in_array('19 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1143 $this->assertTrue(in_array('20 ends in 0 or ends in 10-20 (translated)', $plurals)); | |
1144 $this->assertTrue(in_array('21 ends in 1, not 11 (translated)', $plurals)); | |
1145 $this->assertTrue(in_array('22 everything else (translated)', $plurals)); | |
1146 $this->assertTrue(in_array('23 everything else (translated)', $plurals)); | |
1147 $this->assertTrue(in_array('24 everything else (translated)', $plurals)); | |
1148 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
1149 | |
1150 $coreSingular = $this->__singularFromCore(); | |
1151 $this->assertEqual('Plural Rule 6 (from core translated)', $coreSingular); | |
1152 | |
1153 $corePlurals = $this->__pluralFromCore(); | |
1154 $this->assertTrue(in_array('0 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1155 $this->assertTrue(in_array('1 ends in 1, not 11 (from core translated)', $corePlurals)); | |
1156 $this->assertTrue(in_array('2 everything else (from core translated)', $corePlurals)); | |
1157 $this->assertTrue(in_array('3 everything else (from core translated)', $corePlurals)); | |
1158 $this->assertTrue(in_array('4 everything else (from core translated)', $corePlurals)); | |
1159 $this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals)); | |
1160 $this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals)); | |
1161 $this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals)); | |
1162 $this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals)); | |
1163 $this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals)); | |
1164 $this->assertTrue(in_array('10 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1165 $this->assertTrue(in_array('11 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1166 $this->assertTrue(in_array('12 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1167 $this->assertTrue(in_array('13 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1168 $this->assertTrue(in_array('14 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1169 $this->assertTrue(in_array('15 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1170 $this->assertTrue(in_array('16 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1171 $this->assertTrue(in_array('17 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1172 $this->assertTrue(in_array('18 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1173 $this->assertTrue(in_array('19 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1174 $this->assertTrue(in_array('20 ends in 0 or ends in 10-20 (from core translated)', $corePlurals)); | |
1175 $this->assertTrue(in_array('21 ends in 1, not 11 (from core translated)', $corePlurals)); | |
1176 $this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals)); | |
1177 $this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals)); | |
1178 $this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals)); | |
1179 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
1180 } | |
1181 | |
1182 /** | |
1183 * testPoRulesSeven method | |
1184 * | |
1185 * @access public | |
1186 * @return void | |
1187 */ | |
1188 function testPoRulesSeven() { | |
1189 Configure::write('Config.language', 'rule_7_po'); | |
1190 | |
1191 $singular = $this->__singular(); | |
1192 $this->assertEqual('Plural Rule 7 (translated)', $singular); | |
1193 | |
1194 $plurals = $this->__plural(); | |
1195 $this->assertTrue(in_array('0 everything else (translated)', $plurals)); | |
1196 $this->assertTrue(in_array('1 ends in 1, not 11 (translated)', $plurals)); | |
1197 $this->assertTrue(in_array('2 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1198 $this->assertTrue(in_array('3 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1199 $this->assertTrue(in_array('4 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1200 $this->assertTrue(in_array('5 everything else (translated)', $plurals)); | |
1201 $this->assertTrue(in_array('6 everything else (translated)', $plurals)); | |
1202 $this->assertTrue(in_array('7 everything else (translated)', $plurals)); | |
1203 $this->assertTrue(in_array('8 everything else (translated)', $plurals)); | |
1204 $this->assertTrue(in_array('9 everything else (translated)', $plurals)); | |
1205 $this->assertTrue(in_array('10 everything else (translated)', $plurals)); | |
1206 $this->assertTrue(in_array('11 everything else (translated)', $plurals)); | |
1207 $this->assertTrue(in_array('12 everything else (translated)', $plurals)); | |
1208 $this->assertTrue(in_array('13 everything else (translated)', $plurals)); | |
1209 $this->assertTrue(in_array('14 everything else (translated)', $plurals)); | |
1210 $this->assertTrue(in_array('15 everything else (translated)', $plurals)); | |
1211 $this->assertTrue(in_array('16 everything else (translated)', $plurals)); | |
1212 $this->assertTrue(in_array('17 everything else (translated)', $plurals)); | |
1213 $this->assertTrue(in_array('18 everything else (translated)', $plurals)); | |
1214 $this->assertTrue(in_array('19 everything else (translated)', $plurals)); | |
1215 $this->assertTrue(in_array('20 everything else (translated)', $plurals)); | |
1216 $this->assertTrue(in_array('21 ends in 1, not 11 (translated)', $plurals)); | |
1217 $this->assertTrue(in_array('22 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1218 $this->assertTrue(in_array('23 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1219 $this->assertTrue(in_array('24 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1220 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
1221 | |
1222 $coreSingular = $this->__singularFromCore(); | |
1223 $this->assertEqual('Plural Rule 7 (from core translated)', $coreSingular); | |
1224 | |
1225 $corePlurals = $this->__pluralFromCore(); | |
1226 $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); | |
1227 $this->assertTrue(in_array('1 ends in 1, not 11 (from core translated)', $corePlurals)); | |
1228 $this->assertTrue(in_array('2 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1229 $this->assertTrue(in_array('3 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1230 $this->assertTrue(in_array('4 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1231 $this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals)); | |
1232 $this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals)); | |
1233 $this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals)); | |
1234 $this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals)); | |
1235 $this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals)); | |
1236 $this->assertTrue(in_array('10 everything else (from core translated)', $corePlurals)); | |
1237 $this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals)); | |
1238 $this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals)); | |
1239 $this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals)); | |
1240 $this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals)); | |
1241 $this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals)); | |
1242 $this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals)); | |
1243 $this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals)); | |
1244 $this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals)); | |
1245 $this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals)); | |
1246 $this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals)); | |
1247 $this->assertTrue(in_array('21 ends in 1, not 11 (from core translated)', $corePlurals)); | |
1248 $this->assertTrue(in_array('22 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1249 $this->assertTrue(in_array('23 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1250 $this->assertTrue(in_array('24 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1251 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
1252 } | |
1253 | |
1254 /** | |
1255 * testMoRulesSeven method | |
1256 * | |
1257 * @access public | |
1258 * @return void | |
1259 */ | |
1260 function testMoRulesSeven() { | |
1261 Configure::write('Config.language', 'rule_7_mo'); | |
1262 | |
1263 $singular = $this->__singular(); | |
1264 $this->assertEqual('Plural Rule 7 (translated)', $singular); | |
1265 | |
1266 $plurals = $this->__plural(); | |
1267 $this->assertTrue(in_array('0 everything else (translated)', $plurals)); | |
1268 $this->assertTrue(in_array('1 ends in 1, not 11 (translated)', $plurals)); | |
1269 $this->assertTrue(in_array('2 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1270 $this->assertTrue(in_array('3 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1271 $this->assertTrue(in_array('4 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1272 $this->assertTrue(in_array('5 everything else (translated)', $plurals)); | |
1273 $this->assertTrue(in_array('6 everything else (translated)', $plurals)); | |
1274 $this->assertTrue(in_array('7 everything else (translated)', $plurals)); | |
1275 $this->assertTrue(in_array('8 everything else (translated)', $plurals)); | |
1276 $this->assertTrue(in_array('9 everything else (translated)', $plurals)); | |
1277 $this->assertTrue(in_array('10 everything else (translated)', $plurals)); | |
1278 $this->assertTrue(in_array('11 everything else (translated)', $plurals)); | |
1279 $this->assertTrue(in_array('12 everything else (translated)', $plurals)); | |
1280 $this->assertTrue(in_array('13 everything else (translated)', $plurals)); | |
1281 $this->assertTrue(in_array('14 everything else (translated)', $plurals)); | |
1282 $this->assertTrue(in_array('15 everything else (translated)', $plurals)); | |
1283 $this->assertTrue(in_array('16 everything else (translated)', $plurals)); | |
1284 $this->assertTrue(in_array('17 everything else (translated)', $plurals)); | |
1285 $this->assertTrue(in_array('18 everything else (translated)', $plurals)); | |
1286 $this->assertTrue(in_array('19 everything else (translated)', $plurals)); | |
1287 $this->assertTrue(in_array('20 everything else (translated)', $plurals)); | |
1288 $this->assertTrue(in_array('21 ends in 1, not 11 (translated)', $plurals)); | |
1289 $this->assertTrue(in_array('22 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1290 $this->assertTrue(in_array('23 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1291 $this->assertTrue(in_array('24 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1292 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
1293 | |
1294 $coreSingular = $this->__singularFromCore(); | |
1295 $this->assertEqual('Plural Rule 7 (from core translated)', $coreSingular); | |
1296 | |
1297 $corePlurals = $this->__pluralFromCore(); | |
1298 $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); | |
1299 $this->assertTrue(in_array('1 ends in 1, not 11 (from core translated)', $corePlurals)); | |
1300 $this->assertTrue(in_array('2 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1301 $this->assertTrue(in_array('3 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1302 $this->assertTrue(in_array('4 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1303 $this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals)); | |
1304 $this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals)); | |
1305 $this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals)); | |
1306 $this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals)); | |
1307 $this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals)); | |
1308 $this->assertTrue(in_array('10 everything else (from core translated)', $corePlurals)); | |
1309 $this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals)); | |
1310 $this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals)); | |
1311 $this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals)); | |
1312 $this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals)); | |
1313 $this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals)); | |
1314 $this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals)); | |
1315 $this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals)); | |
1316 $this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals)); | |
1317 $this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals)); | |
1318 $this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals)); | |
1319 $this->assertTrue(in_array('21 ends in 1, not 11 (from core translated)', $corePlurals)); | |
1320 $this->assertTrue(in_array('22 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1321 $this->assertTrue(in_array('23 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1322 $this->assertTrue(in_array('24 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1323 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
1324 } | |
1325 | |
1326 /** | |
1327 * testPoRulesEight method | |
1328 * | |
1329 * @access public | |
1330 * @return void | |
1331 */ | |
1332 function testPoRulesEight() { | |
1333 Configure::write('Config.language', 'rule_8_po'); | |
1334 | |
1335 $singular = $this->__singular(); | |
1336 $this->assertEqual('Plural Rule 8 (translated)', $singular); | |
1337 | |
1338 $plurals = $this->__plural(); | |
1339 $this->assertTrue(in_array('0 everything else (translated)', $plurals)); | |
1340 $this->assertTrue(in_array('1 is 1 (translated)', $plurals)); | |
1341 $this->assertTrue(in_array('2 is 2-4 (translated)', $plurals)); | |
1342 $this->assertTrue(in_array('3 is 2-4 (translated)', $plurals)); | |
1343 $this->assertTrue(in_array('4 is 2-4 (translated)', $plurals)); | |
1344 $this->assertTrue(in_array('5 everything else (translated)', $plurals)); | |
1345 $this->assertTrue(in_array('6 everything else (translated)', $plurals)); | |
1346 $this->assertTrue(in_array('7 everything else (translated)', $plurals)); | |
1347 $this->assertTrue(in_array('8 everything else (translated)', $plurals)); | |
1348 $this->assertTrue(in_array('9 everything else (translated)', $plurals)); | |
1349 $this->assertTrue(in_array('10 everything else (translated)', $plurals)); | |
1350 $this->assertTrue(in_array('11 everything else (translated)', $plurals)); | |
1351 $this->assertTrue(in_array('12 everything else (translated)', $plurals)); | |
1352 $this->assertTrue(in_array('13 everything else (translated)', $plurals)); | |
1353 $this->assertTrue(in_array('14 everything else (translated)', $plurals)); | |
1354 $this->assertTrue(in_array('15 everything else (translated)', $plurals)); | |
1355 $this->assertTrue(in_array('16 everything else (translated)', $plurals)); | |
1356 $this->assertTrue(in_array('17 everything else (translated)', $plurals)); | |
1357 $this->assertTrue(in_array('18 everything else (translated)', $plurals)); | |
1358 $this->assertTrue(in_array('19 everything else (translated)', $plurals)); | |
1359 $this->assertTrue(in_array('20 everything else (translated)', $plurals)); | |
1360 $this->assertTrue(in_array('21 everything else (translated)', $plurals)); | |
1361 $this->assertTrue(in_array('22 everything else (translated)', $plurals)); | |
1362 $this->assertTrue(in_array('23 everything else (translated)', $plurals)); | |
1363 $this->assertTrue(in_array('24 everything else (translated)', $plurals)); | |
1364 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
1365 | |
1366 $coreSingular = $this->__singularFromCore(); | |
1367 $this->assertEqual('Plural Rule 8 (from core translated)', $coreSingular); | |
1368 | |
1369 $corePlurals = $this->__pluralFromCore(); | |
1370 $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); | |
1371 $this->assertTrue(in_array('1 is 1 (from core translated)', $corePlurals)); | |
1372 $this->assertTrue(in_array('2 is 2-4 (from core translated)', $corePlurals)); | |
1373 $this->assertTrue(in_array('3 is 2-4 (from core translated)', $corePlurals)); | |
1374 $this->assertTrue(in_array('4 is 2-4 (from core translated)', $corePlurals)); | |
1375 $this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals)); | |
1376 $this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals)); | |
1377 $this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals)); | |
1378 $this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals)); | |
1379 $this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals)); | |
1380 $this->assertTrue(in_array('10 everything else (from core translated)', $corePlurals)); | |
1381 $this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals)); | |
1382 $this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals)); | |
1383 $this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals)); | |
1384 $this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals)); | |
1385 $this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals)); | |
1386 $this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals)); | |
1387 $this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals)); | |
1388 $this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals)); | |
1389 $this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals)); | |
1390 $this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals)); | |
1391 $this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals)); | |
1392 $this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals)); | |
1393 $this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals)); | |
1394 $this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals)); | |
1395 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
1396 } | |
1397 | |
1398 /** | |
1399 * testMoRulesEight method | |
1400 * | |
1401 * @access public | |
1402 * @return void | |
1403 */ | |
1404 function testMoRulesEight() { | |
1405 Configure::write('Config.language', 'rule_8_mo'); | |
1406 | |
1407 $singular = $this->__singular(); | |
1408 $this->assertEqual('Plural Rule 8 (translated)', $singular); | |
1409 | |
1410 $plurals = $this->__plural(); | |
1411 $this->assertTrue(in_array('0 everything else (translated)', $plurals)); | |
1412 $this->assertTrue(in_array('1 is 1 (translated)', $plurals)); | |
1413 $this->assertTrue(in_array('2 is 2-4 (translated)', $plurals)); | |
1414 $this->assertTrue(in_array('3 is 2-4 (translated)', $plurals)); | |
1415 $this->assertTrue(in_array('4 is 2-4 (translated)', $plurals)); | |
1416 $this->assertTrue(in_array('5 everything else (translated)', $plurals)); | |
1417 $this->assertTrue(in_array('6 everything else (translated)', $plurals)); | |
1418 $this->assertTrue(in_array('7 everything else (translated)', $plurals)); | |
1419 $this->assertTrue(in_array('8 everything else (translated)', $plurals)); | |
1420 $this->assertTrue(in_array('9 everything else (translated)', $plurals)); | |
1421 $this->assertTrue(in_array('10 everything else (translated)', $plurals)); | |
1422 $this->assertTrue(in_array('11 everything else (translated)', $plurals)); | |
1423 $this->assertTrue(in_array('12 everything else (translated)', $plurals)); | |
1424 $this->assertTrue(in_array('13 everything else (translated)', $plurals)); | |
1425 $this->assertTrue(in_array('14 everything else (translated)', $plurals)); | |
1426 $this->assertTrue(in_array('15 everything else (translated)', $plurals)); | |
1427 $this->assertTrue(in_array('16 everything else (translated)', $plurals)); | |
1428 $this->assertTrue(in_array('17 everything else (translated)', $plurals)); | |
1429 $this->assertTrue(in_array('18 everything else (translated)', $plurals)); | |
1430 $this->assertTrue(in_array('19 everything else (translated)', $plurals)); | |
1431 $this->assertTrue(in_array('20 everything else (translated)', $plurals)); | |
1432 $this->assertTrue(in_array('21 everything else (translated)', $plurals)); | |
1433 $this->assertTrue(in_array('22 everything else (translated)', $plurals)); | |
1434 $this->assertTrue(in_array('23 everything else (translated)', $plurals)); | |
1435 $this->assertTrue(in_array('24 everything else (translated)', $plurals)); | |
1436 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
1437 | |
1438 $coreSingular = $this->__singularFromCore(); | |
1439 $this->assertEqual('Plural Rule 8 (from core translated)', $coreSingular); | |
1440 | |
1441 $corePlurals = $this->__pluralFromCore(); | |
1442 $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); | |
1443 $this->assertTrue(in_array('1 is 1 (from core translated)', $corePlurals)); | |
1444 $this->assertTrue(in_array('2 is 2-4 (from core translated)', $corePlurals)); | |
1445 $this->assertTrue(in_array('3 is 2-4 (from core translated)', $corePlurals)); | |
1446 $this->assertTrue(in_array('4 is 2-4 (from core translated)', $corePlurals)); | |
1447 $this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals)); | |
1448 $this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals)); | |
1449 $this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals)); | |
1450 $this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals)); | |
1451 $this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals)); | |
1452 $this->assertTrue(in_array('10 everything else (from core translated)', $corePlurals)); | |
1453 $this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals)); | |
1454 $this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals)); | |
1455 $this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals)); | |
1456 $this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals)); | |
1457 $this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals)); | |
1458 $this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals)); | |
1459 $this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals)); | |
1460 $this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals)); | |
1461 $this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals)); | |
1462 $this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals)); | |
1463 $this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals)); | |
1464 $this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals)); | |
1465 $this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals)); | |
1466 $this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals)); | |
1467 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
1468 } | |
1469 | |
1470 /** | |
1471 * testPoRulesNine method | |
1472 * | |
1473 * @access public | |
1474 * @return void | |
1475 */ | |
1476 function testPoRulesNine() { | |
1477 Configure::write('Config.language', 'rule_9_po'); | |
1478 | |
1479 $singular = $this->__singular(); | |
1480 $this->assertEqual('Plural Rule 9 (translated)', $singular); | |
1481 | |
1482 $plurals = $this->__plural(); | |
1483 $this->assertTrue(in_array('0 everything else (translated)', $plurals)); | |
1484 $this->assertTrue(in_array('0 everything else (translated)', $plurals)); | |
1485 $this->assertTrue(in_array('1 is 1 (translated)', $plurals)); | |
1486 $this->assertTrue(in_array('2 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1487 $this->assertTrue(in_array('3 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1488 $this->assertTrue(in_array('4 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1489 $this->assertTrue(in_array('5 everything else (translated)', $plurals)); | |
1490 $this->assertTrue(in_array('6 everything else (translated)', $plurals)); | |
1491 $this->assertTrue(in_array('7 everything else (translated)', $plurals)); | |
1492 $this->assertTrue(in_array('8 everything else (translated)', $plurals)); | |
1493 $this->assertTrue(in_array('9 everything else (translated)', $plurals)); | |
1494 $this->assertTrue(in_array('10 everything else (translated)', $plurals)); | |
1495 $this->assertTrue(in_array('11 everything else (translated)', $plurals)); | |
1496 $this->assertTrue(in_array('12 everything else (translated)', $plurals)); | |
1497 $this->assertTrue(in_array('13 everything else (translated)', $plurals)); | |
1498 $this->assertTrue(in_array('14 everything else (translated)', $plurals)); | |
1499 $this->assertTrue(in_array('15 everything else (translated)', $plurals)); | |
1500 $this->assertTrue(in_array('16 everything else (translated)', $plurals)); | |
1501 $this->assertTrue(in_array('17 everything else (translated)', $plurals)); | |
1502 $this->assertTrue(in_array('18 everything else (translated)', $plurals)); | |
1503 $this->assertTrue(in_array('19 everything else (translated)', $plurals)); | |
1504 $this->assertTrue(in_array('20 everything else (translated)', $plurals)); | |
1505 $this->assertTrue(in_array('21 everything else (translated)', $plurals)); | |
1506 $this->assertTrue(in_array('22 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1507 $this->assertTrue(in_array('23 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1508 $this->assertTrue(in_array('24 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1509 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
1510 | |
1511 $coreSingular = $this->__singularFromCore(); | |
1512 $this->assertEqual('Plural Rule 9 (from core translated)', $coreSingular); | |
1513 | |
1514 $corePlurals = $this->__pluralFromCore(); | |
1515 $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); | |
1516 $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); | |
1517 $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); | |
1518 $this->assertTrue(in_array('1 is 1 (from core translated)', $corePlurals)); | |
1519 $this->assertTrue(in_array('2 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1520 $this->assertTrue(in_array('3 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1521 $this->assertTrue(in_array('4 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1522 $this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals)); | |
1523 $this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals)); | |
1524 $this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals)); | |
1525 $this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals)); | |
1526 $this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals)); | |
1527 $this->assertTrue(in_array('10 everything else (from core translated)', $corePlurals)); | |
1528 $this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals)); | |
1529 $this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals)); | |
1530 $this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals)); | |
1531 $this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals)); | |
1532 $this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals)); | |
1533 $this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals)); | |
1534 $this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals)); | |
1535 $this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals)); | |
1536 $this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals)); | |
1537 $this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals)); | |
1538 $this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals)); | |
1539 $this->assertTrue(in_array('22 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1540 $this->assertTrue(in_array('23 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1541 $this->assertTrue(in_array('24 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1542 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
1543 } | |
1544 | |
1545 /** | |
1546 * testMoRulesNine method | |
1547 * | |
1548 * @access public | |
1549 * @return void | |
1550 */ | |
1551 function testMoRulesNine() { | |
1552 Configure::write('Config.language', 'rule_9_po'); | |
1553 | |
1554 $singular = $this->__singular(); | |
1555 $this->assertEqual('Plural Rule 9 (translated)', $singular); | |
1556 | |
1557 $plurals = $this->__plural(); | |
1558 $this->assertTrue(in_array('0 everything else (translated)', $plurals)); | |
1559 $this->assertTrue(in_array('0 everything else (translated)', $plurals)); | |
1560 $this->assertTrue(in_array('1 is 1 (translated)', $plurals)); | |
1561 $this->assertTrue(in_array('2 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1562 $this->assertTrue(in_array('3 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1563 $this->assertTrue(in_array('4 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1564 $this->assertTrue(in_array('5 everything else (translated)', $plurals)); | |
1565 $this->assertTrue(in_array('6 everything else (translated)', $plurals)); | |
1566 $this->assertTrue(in_array('7 everything else (translated)', $plurals)); | |
1567 $this->assertTrue(in_array('8 everything else (translated)', $plurals)); | |
1568 $this->assertTrue(in_array('9 everything else (translated)', $plurals)); | |
1569 $this->assertTrue(in_array('10 everything else (translated)', $plurals)); | |
1570 $this->assertTrue(in_array('11 everything else (translated)', $plurals)); | |
1571 $this->assertTrue(in_array('12 everything else (translated)', $plurals)); | |
1572 $this->assertTrue(in_array('13 everything else (translated)', $plurals)); | |
1573 $this->assertTrue(in_array('14 everything else (translated)', $plurals)); | |
1574 $this->assertTrue(in_array('15 everything else (translated)', $plurals)); | |
1575 $this->assertTrue(in_array('16 everything else (translated)', $plurals)); | |
1576 $this->assertTrue(in_array('17 everything else (translated)', $plurals)); | |
1577 $this->assertTrue(in_array('18 everything else (translated)', $plurals)); | |
1578 $this->assertTrue(in_array('19 everything else (translated)', $plurals)); | |
1579 $this->assertTrue(in_array('20 everything else (translated)', $plurals)); | |
1580 $this->assertTrue(in_array('21 everything else (translated)', $plurals)); | |
1581 $this->assertTrue(in_array('22 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1582 $this->assertTrue(in_array('23 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1583 $this->assertTrue(in_array('24 ends in 2-4, not 12-14 (translated)', $plurals)); | |
1584 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
1585 | |
1586 $coreSingular = $this->__singularFromCore(); | |
1587 $this->assertEqual('Plural Rule 9 (from core translated)', $coreSingular); | |
1588 | |
1589 $corePlurals = $this->__pluralFromCore(); | |
1590 $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); | |
1591 $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); | |
1592 $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); | |
1593 $this->assertTrue(in_array('1 is 1 (from core translated)', $corePlurals)); | |
1594 $this->assertTrue(in_array('2 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1595 $this->assertTrue(in_array('3 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1596 $this->assertTrue(in_array('4 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1597 $this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals)); | |
1598 $this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals)); | |
1599 $this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals)); | |
1600 $this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals)); | |
1601 $this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals)); | |
1602 $this->assertTrue(in_array('10 everything else (from core translated)', $corePlurals)); | |
1603 $this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals)); | |
1604 $this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals)); | |
1605 $this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals)); | |
1606 $this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals)); | |
1607 $this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals)); | |
1608 $this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals)); | |
1609 $this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals)); | |
1610 $this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals)); | |
1611 $this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals)); | |
1612 $this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals)); | |
1613 $this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals)); | |
1614 $this->assertTrue(in_array('22 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1615 $this->assertTrue(in_array('23 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1616 $this->assertTrue(in_array('24 ends in 2-4, not 12-14 (from core translated)', $corePlurals)); | |
1617 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
1618 } | |
1619 | |
1620 /** | |
1621 * testPoRulesTen method | |
1622 * | |
1623 * @access public | |
1624 * @return void | |
1625 */ | |
1626 function testPoRulesTen() { | |
1627 Configure::write('Config.language', 'rule_10_po'); | |
1628 | |
1629 $singular = $this->__singular(); | |
1630 $this->assertEqual('Plural Rule 10 (translated)', $singular); | |
1631 | |
1632 $plurals = $this->__plural(); | |
1633 $this->assertTrue(in_array('0 everything else (translated)', $plurals)); | |
1634 $this->assertTrue(in_array('0 everything else (translated)', $plurals)); | |
1635 $this->assertTrue(in_array('1 ends in 1 (translated)', $plurals)); | |
1636 $this->assertTrue(in_array('2 ends in 2 (translated)', $plurals)); | |
1637 $this->assertTrue(in_array('3 ends in 03-04 (translated)', $plurals)); | |
1638 $this->assertTrue(in_array('4 ends in 03-04 (translated)', $plurals)); | |
1639 $this->assertTrue(in_array('5 everything else (translated)', $plurals)); | |
1640 $this->assertTrue(in_array('6 everything else (translated)', $plurals)); | |
1641 $this->assertTrue(in_array('7 everything else (translated)', $plurals)); | |
1642 $this->assertTrue(in_array('8 everything else (translated)', $plurals)); | |
1643 $this->assertTrue(in_array('9 everything else (translated)', $plurals)); | |
1644 $this->assertTrue(in_array('10 everything else (translated)', $plurals)); | |
1645 $this->assertTrue(in_array('11 everything else (translated)', $plurals)); | |
1646 $this->assertTrue(in_array('12 everything else (translated)', $plurals)); | |
1647 $this->assertTrue(in_array('13 everything else (translated)', $plurals)); | |
1648 $this->assertTrue(in_array('14 everything else (translated)', $plurals)); | |
1649 $this->assertTrue(in_array('15 everything else (translated)', $plurals)); | |
1650 $this->assertTrue(in_array('16 everything else (translated)', $plurals)); | |
1651 $this->assertTrue(in_array('17 everything else (translated)', $plurals)); | |
1652 $this->assertTrue(in_array('18 everything else (translated)', $plurals)); | |
1653 $this->assertTrue(in_array('19 everything else (translated)', $plurals)); | |
1654 $this->assertTrue(in_array('20 everything else (translated)', $plurals)); | |
1655 $this->assertTrue(in_array('21 everything else (translated)', $plurals)); | |
1656 $this->assertTrue(in_array('22 everything else (translated)', $plurals)); | |
1657 $this->assertTrue(in_array('23 everything else (translated)', $plurals)); | |
1658 $this->assertTrue(in_array('24 everything else (translated)', $plurals)); | |
1659 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
1660 | |
1661 $coreSingular = $this->__singularFromCore(); | |
1662 $this->assertEqual('Plural Rule 10 (from core translated)', $coreSingular); | |
1663 | |
1664 $corePlurals = $this->__pluralFromCore(); | |
1665 $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); | |
1666 $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); | |
1667 $this->assertTrue(in_array('1 ends in 1 (from core translated)', $corePlurals)); | |
1668 $this->assertTrue(in_array('2 ends in 2 (from core translated)', $corePlurals)); | |
1669 $this->assertTrue(in_array('3 ends in 03-04 (from core translated)', $corePlurals)); | |
1670 $this->assertTrue(in_array('4 ends in 03-04 (from core translated)', $corePlurals)); | |
1671 $this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals)); | |
1672 $this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals)); | |
1673 $this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals)); | |
1674 $this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals)); | |
1675 $this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals)); | |
1676 $this->assertTrue(in_array('10 everything else (from core translated)', $corePlurals)); | |
1677 $this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals)); | |
1678 $this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals)); | |
1679 $this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals)); | |
1680 $this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals)); | |
1681 $this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals)); | |
1682 $this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals)); | |
1683 $this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals)); | |
1684 $this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals)); | |
1685 $this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals)); | |
1686 $this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals)); | |
1687 $this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals)); | |
1688 $this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals)); | |
1689 $this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals)); | |
1690 $this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals)); | |
1691 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
1692 } | |
1693 | |
1694 /** | |
1695 * testMoRulesTen method | |
1696 * | |
1697 * @access public | |
1698 * @return void | |
1699 */ | |
1700 function testMoRulesTen() { | |
1701 Configure::write('Config.language', 'rule_10_mo'); | |
1702 | |
1703 $singular = $this->__singular(); | |
1704 $this->assertEqual('Plural Rule 10 (translated)', $singular); | |
1705 | |
1706 $plurals = $this->__plural(); | |
1707 $this->assertTrue(in_array('0 everything else (translated)', $plurals)); | |
1708 $this->assertTrue(in_array('0 everything else (translated)', $plurals)); | |
1709 $this->assertTrue(in_array('1 ends in 1 (translated)', $plurals)); | |
1710 $this->assertTrue(in_array('2 ends in 2 (translated)', $plurals)); | |
1711 $this->assertTrue(in_array('3 ends in 03-04 (translated)', $plurals)); | |
1712 $this->assertTrue(in_array('4 ends in 03-04 (translated)', $plurals)); | |
1713 $this->assertTrue(in_array('5 everything else (translated)', $plurals)); | |
1714 $this->assertTrue(in_array('6 everything else (translated)', $plurals)); | |
1715 $this->assertTrue(in_array('7 everything else (translated)', $plurals)); | |
1716 $this->assertTrue(in_array('8 everything else (translated)', $plurals)); | |
1717 $this->assertTrue(in_array('9 everything else (translated)', $plurals)); | |
1718 $this->assertTrue(in_array('10 everything else (translated)', $plurals)); | |
1719 $this->assertTrue(in_array('11 everything else (translated)', $plurals)); | |
1720 $this->assertTrue(in_array('12 everything else (translated)', $plurals)); | |
1721 $this->assertTrue(in_array('13 everything else (translated)', $plurals)); | |
1722 $this->assertTrue(in_array('14 everything else (translated)', $plurals)); | |
1723 $this->assertTrue(in_array('15 everything else (translated)', $plurals)); | |
1724 $this->assertTrue(in_array('16 everything else (translated)', $plurals)); | |
1725 $this->assertTrue(in_array('17 everything else (translated)', $plurals)); | |
1726 $this->assertTrue(in_array('18 everything else (translated)', $plurals)); | |
1727 $this->assertTrue(in_array('19 everything else (translated)', $plurals)); | |
1728 $this->assertTrue(in_array('20 everything else (translated)', $plurals)); | |
1729 $this->assertTrue(in_array('21 everything else (translated)', $plurals)); | |
1730 $this->assertTrue(in_array('22 everything else (translated)', $plurals)); | |
1731 $this->assertTrue(in_array('23 everything else (translated)', $plurals)); | |
1732 $this->assertTrue(in_array('24 everything else (translated)', $plurals)); | |
1733 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
1734 | |
1735 $coreSingular = $this->__singularFromCore(); | |
1736 $this->assertEqual('Plural Rule 10 (from core translated)', $coreSingular); | |
1737 | |
1738 $corePlurals = $this->__pluralFromCore(); | |
1739 $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); | |
1740 $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); | |
1741 $this->assertTrue(in_array('1 ends in 1 (from core translated)', $corePlurals)); | |
1742 $this->assertTrue(in_array('2 ends in 2 (from core translated)', $corePlurals)); | |
1743 $this->assertTrue(in_array('3 ends in 03-04 (from core translated)', $corePlurals)); | |
1744 $this->assertTrue(in_array('4 ends in 03-04 (from core translated)', $corePlurals)); | |
1745 $this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals)); | |
1746 $this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals)); | |
1747 $this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals)); | |
1748 $this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals)); | |
1749 $this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals)); | |
1750 $this->assertTrue(in_array('10 everything else (from core translated)', $corePlurals)); | |
1751 $this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals)); | |
1752 $this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals)); | |
1753 $this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals)); | |
1754 $this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals)); | |
1755 $this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals)); | |
1756 $this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals)); | |
1757 $this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals)); | |
1758 $this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals)); | |
1759 $this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals)); | |
1760 $this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals)); | |
1761 $this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals)); | |
1762 $this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals)); | |
1763 $this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals)); | |
1764 $this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals)); | |
1765 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
1766 } | |
1767 | |
1768 /** | |
1769 * testPoRulesEleven method | |
1770 * | |
1771 * @access public | |
1772 * @return void | |
1773 */ | |
1774 function testPoRulesEleven() { | |
1775 Configure::write('Config.language', 'rule_11_po'); | |
1776 | |
1777 $singular = $this->__singular(); | |
1778 $this->assertEqual('Plural Rule 11 (translated)', $singular); | |
1779 | |
1780 $plurals = $this->__plural(); | |
1781 $this->assertTrue(in_array('0 everything else (translated)', $plurals)); | |
1782 $this->assertTrue(in_array('1 is 1 (translated)', $plurals)); | |
1783 $this->assertTrue(in_array('2 is 2 (translated)', $plurals)); | |
1784 $this->assertTrue(in_array('3 is 3-6 (translated)', $plurals)); | |
1785 $this->assertTrue(in_array('4 is 3-6 (translated)', $plurals)); | |
1786 $this->assertTrue(in_array('5 is 3-6 (translated)', $plurals)); | |
1787 $this->assertTrue(in_array('6 is 3-6 (translated)', $plurals)); | |
1788 $this->assertTrue(in_array('7 is 7-10 (translated)', $plurals)); | |
1789 $this->assertTrue(in_array('8 is 7-10 (translated)', $plurals)); | |
1790 $this->assertTrue(in_array('9 is 7-10 (translated)', $plurals)); | |
1791 $this->assertTrue(in_array('10 is 7-10 (translated)', $plurals)); | |
1792 $this->assertTrue(in_array('11 everything else (translated)', $plurals)); | |
1793 $this->assertTrue(in_array('12 everything else (translated)', $plurals)); | |
1794 $this->assertTrue(in_array('13 everything else (translated)', $plurals)); | |
1795 $this->assertTrue(in_array('14 everything else (translated)', $plurals)); | |
1796 $this->assertTrue(in_array('15 everything else (translated)', $plurals)); | |
1797 $this->assertTrue(in_array('16 everything else (translated)', $plurals)); | |
1798 $this->assertTrue(in_array('17 everything else (translated)', $plurals)); | |
1799 $this->assertTrue(in_array('18 everything else (translated)', $plurals)); | |
1800 $this->assertTrue(in_array('19 everything else (translated)', $plurals)); | |
1801 $this->assertTrue(in_array('20 everything else (translated)', $plurals)); | |
1802 $this->assertTrue(in_array('21 everything else (translated)', $plurals)); | |
1803 $this->assertTrue(in_array('22 everything else (translated)', $plurals)); | |
1804 $this->assertTrue(in_array('23 everything else (translated)', $plurals)); | |
1805 $this->assertTrue(in_array('24 everything else (translated)', $plurals)); | |
1806 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
1807 | |
1808 $coreSingular = $this->__singularFromCore(); | |
1809 $this->assertEqual('Plural Rule 11 (from core translated)', $coreSingular); | |
1810 | |
1811 $corePlurals = $this->__pluralFromCore(); | |
1812 $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); | |
1813 $this->assertTrue(in_array('1 is 1 (from core translated)', $corePlurals)); | |
1814 $this->assertTrue(in_array('2 is 2 (from core translated)', $corePlurals)); | |
1815 $this->assertTrue(in_array('3 is 3-6 (from core translated)', $corePlurals)); | |
1816 $this->assertTrue(in_array('4 is 3-6 (from core translated)', $corePlurals)); | |
1817 $this->assertTrue(in_array('5 is 3-6 (from core translated)', $corePlurals)); | |
1818 $this->assertTrue(in_array('6 is 3-6 (from core translated)', $corePlurals)); | |
1819 $this->assertTrue(in_array('7 is 7-10 (from core translated)', $corePlurals)); | |
1820 $this->assertTrue(in_array('8 is 7-10 (from core translated)', $corePlurals)); | |
1821 $this->assertTrue(in_array('9 is 7-10 (from core translated)', $corePlurals)); | |
1822 $this->assertTrue(in_array('10 is 7-10 (from core translated)', $corePlurals)); | |
1823 $this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals)); | |
1824 $this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals)); | |
1825 $this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals)); | |
1826 $this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals)); | |
1827 $this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals)); | |
1828 $this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals)); | |
1829 $this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals)); | |
1830 $this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals)); | |
1831 $this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals)); | |
1832 $this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals)); | |
1833 $this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals)); | |
1834 $this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals)); | |
1835 $this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals)); | |
1836 $this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals)); | |
1837 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
1838 } | |
1839 | |
1840 /** | |
1841 * testMoRulesEleven method | |
1842 * | |
1843 * @access public | |
1844 * @return void | |
1845 */ | |
1846 function testMoRulesEleven() { | |
1847 Configure::write('Config.language', 'rule_11_mo'); | |
1848 | |
1849 $singular = $this->__singular(); | |
1850 $this->assertEqual('Plural Rule 11 (translated)', $singular); | |
1851 | |
1852 $plurals = $this->__plural(); | |
1853 $this->assertTrue(in_array('0 everything else (translated)', $plurals)); | |
1854 $this->assertTrue(in_array('1 is 1 (translated)', $plurals)); | |
1855 $this->assertTrue(in_array('2 is 2 (translated)', $plurals)); | |
1856 $this->assertTrue(in_array('3 is 3-6 (translated)', $plurals)); | |
1857 $this->assertTrue(in_array('4 is 3-6 (translated)', $plurals)); | |
1858 $this->assertTrue(in_array('5 is 3-6 (translated)', $plurals)); | |
1859 $this->assertTrue(in_array('6 is 3-6 (translated)', $plurals)); | |
1860 $this->assertTrue(in_array('7 is 7-10 (translated)', $plurals)); | |
1861 $this->assertTrue(in_array('8 is 7-10 (translated)', $plurals)); | |
1862 $this->assertTrue(in_array('9 is 7-10 (translated)', $plurals)); | |
1863 $this->assertTrue(in_array('10 is 7-10 (translated)', $plurals)); | |
1864 $this->assertTrue(in_array('11 everything else (translated)', $plurals)); | |
1865 $this->assertTrue(in_array('12 everything else (translated)', $plurals)); | |
1866 $this->assertTrue(in_array('13 everything else (translated)', $plurals)); | |
1867 $this->assertTrue(in_array('14 everything else (translated)', $plurals)); | |
1868 $this->assertTrue(in_array('15 everything else (translated)', $plurals)); | |
1869 $this->assertTrue(in_array('16 everything else (translated)', $plurals)); | |
1870 $this->assertTrue(in_array('17 everything else (translated)', $plurals)); | |
1871 $this->assertTrue(in_array('18 everything else (translated)', $plurals)); | |
1872 $this->assertTrue(in_array('19 everything else (translated)', $plurals)); | |
1873 $this->assertTrue(in_array('20 everything else (translated)', $plurals)); | |
1874 $this->assertTrue(in_array('21 everything else (translated)', $plurals)); | |
1875 $this->assertTrue(in_array('22 everything else (translated)', $plurals)); | |
1876 $this->assertTrue(in_array('23 everything else (translated)', $plurals)); | |
1877 $this->assertTrue(in_array('24 everything else (translated)', $plurals)); | |
1878 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
1879 | |
1880 $coreSingular = $this->__singularFromCore(); | |
1881 $this->assertEqual('Plural Rule 11 (from core translated)', $coreSingular); | |
1882 | |
1883 $corePlurals = $this->__pluralFromCore(); | |
1884 $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); | |
1885 $this->assertTrue(in_array('1 is 1 (from core translated)', $corePlurals)); | |
1886 $this->assertTrue(in_array('2 is 2 (from core translated)', $corePlurals)); | |
1887 $this->assertTrue(in_array('3 is 3-6 (from core translated)', $corePlurals)); | |
1888 $this->assertTrue(in_array('4 is 3-6 (from core translated)', $corePlurals)); | |
1889 $this->assertTrue(in_array('5 is 3-6 (from core translated)', $corePlurals)); | |
1890 $this->assertTrue(in_array('6 is 3-6 (from core translated)', $corePlurals)); | |
1891 $this->assertTrue(in_array('7 is 7-10 (from core translated)', $corePlurals)); | |
1892 $this->assertTrue(in_array('8 is 7-10 (from core translated)', $corePlurals)); | |
1893 $this->assertTrue(in_array('9 is 7-10 (from core translated)', $corePlurals)); | |
1894 $this->assertTrue(in_array('10 is 7-10 (from core translated)', $corePlurals)); | |
1895 $this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals)); | |
1896 $this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals)); | |
1897 $this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals)); | |
1898 $this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals)); | |
1899 $this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals)); | |
1900 $this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals)); | |
1901 $this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals)); | |
1902 $this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals)); | |
1903 $this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals)); | |
1904 $this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals)); | |
1905 $this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals)); | |
1906 $this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals)); | |
1907 $this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals)); | |
1908 $this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals)); | |
1909 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
1910 } | |
1911 | |
1912 /** | |
1913 * testPoRulesTwelve method | |
1914 * | |
1915 * @access public | |
1916 * @return void | |
1917 */ | |
1918 function testPoRulesTwelve() { | |
1919 Configure::write('Config.language', 'rule_12_po'); | |
1920 | |
1921 $singular = $this->__singular(); | |
1922 $this->assertEqual('Plural Rule 12 (translated)', $singular); | |
1923 | |
1924 $plurals = $this->__plural(); | |
1925 $this->assertTrue(in_array('0 is 0 or 3-10 (translated)', $plurals)); | |
1926 $this->assertTrue(in_array('1 is 1 (translated)', $plurals)); | |
1927 $this->assertTrue(in_array('2 is 2 (translated)', $plurals)); | |
1928 $this->assertTrue(in_array('3 is 0 or 3-10 (translated)', $plurals)); | |
1929 $this->assertTrue(in_array('4 is 0 or 3-10 (translated)', $plurals)); | |
1930 $this->assertTrue(in_array('5 is 0 or 3-10 (translated)', $plurals)); | |
1931 $this->assertTrue(in_array('6 is 0 or 3-10 (translated)', $plurals)); | |
1932 $this->assertTrue(in_array('7 is 0 or 3-10 (translated)', $plurals)); | |
1933 $this->assertTrue(in_array('8 is 0 or 3-10 (translated)', $plurals)); | |
1934 $this->assertTrue(in_array('9 is 0 or 3-10 (translated)', $plurals)); | |
1935 $this->assertTrue(in_array('10 is 0 or 3-10 (translated)', $plurals)); | |
1936 $this->assertTrue(in_array('11 everything else (translated)', $plurals)); | |
1937 $this->assertTrue(in_array('12 everything else (translated)', $plurals)); | |
1938 $this->assertTrue(in_array('13 everything else (translated)', $plurals)); | |
1939 $this->assertTrue(in_array('14 everything else (translated)', $plurals)); | |
1940 $this->assertTrue(in_array('15 everything else (translated)', $plurals)); | |
1941 $this->assertTrue(in_array('16 everything else (translated)', $plurals)); | |
1942 $this->assertTrue(in_array('17 everything else (translated)', $plurals)); | |
1943 $this->assertTrue(in_array('18 everything else (translated)', $plurals)); | |
1944 $this->assertTrue(in_array('19 everything else (translated)', $plurals)); | |
1945 $this->assertTrue(in_array('20 everything else (translated)', $plurals)); | |
1946 $this->assertTrue(in_array('21 everything else (translated)', $plurals)); | |
1947 $this->assertTrue(in_array('22 everything else (translated)', $plurals)); | |
1948 $this->assertTrue(in_array('23 everything else (translated)', $plurals)); | |
1949 $this->assertTrue(in_array('24 everything else (translated)', $plurals)); | |
1950 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
1951 | |
1952 $coreSingular = $this->__singularFromCore(); | |
1953 $this->assertEqual('Plural Rule 12 (from core translated)', $coreSingular); | |
1954 | |
1955 $corePlurals = $this->__pluralFromCore(); | |
1956 $this->assertTrue(in_array('0 is 0 or 3-10 (from core translated)', $corePlurals)); | |
1957 $this->assertTrue(in_array('1 is 1 (from core translated)', $corePlurals)); | |
1958 $this->assertTrue(in_array('2 is 2 (from core translated)', $corePlurals)); | |
1959 $this->assertTrue(in_array('3 is 0 or 3-10 (from core translated)', $corePlurals)); | |
1960 $this->assertTrue(in_array('4 is 0 or 3-10 (from core translated)', $corePlurals)); | |
1961 $this->assertTrue(in_array('5 is 0 or 3-10 (from core translated)', $corePlurals)); | |
1962 $this->assertTrue(in_array('6 is 0 or 3-10 (from core translated)', $corePlurals)); | |
1963 $this->assertTrue(in_array('7 is 0 or 3-10 (from core translated)', $corePlurals)); | |
1964 $this->assertTrue(in_array('8 is 0 or 3-10 (from core translated)', $corePlurals)); | |
1965 $this->assertTrue(in_array('9 is 0 or 3-10 (from core translated)', $corePlurals)); | |
1966 $this->assertTrue(in_array('10 is 0 or 3-10 (from core translated)', $corePlurals)); | |
1967 $this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals)); | |
1968 $this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals)); | |
1969 $this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals)); | |
1970 $this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals)); | |
1971 $this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals)); | |
1972 $this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals)); | |
1973 $this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals)); | |
1974 $this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals)); | |
1975 $this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals)); | |
1976 $this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals)); | |
1977 $this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals)); | |
1978 $this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals)); | |
1979 $this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals)); | |
1980 $this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals)); | |
1981 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
1982 } | |
1983 | |
1984 /** | |
1985 * testMoRulesTwelve method | |
1986 * | |
1987 * @access public | |
1988 * @return void | |
1989 */ | |
1990 function testMoRulesTwelve() { | |
1991 Configure::write('Config.language', 'rule_12_mo'); | |
1992 | |
1993 $singular = $this->__singular(); | |
1994 $this->assertEqual('Plural Rule 12 (translated)', $singular); | |
1995 | |
1996 $plurals = $this->__plural(); | |
1997 $this->assertTrue(in_array('0 is 0 or 3-10 (translated)', $plurals)); | |
1998 $this->assertTrue(in_array('1 is 1 (translated)', $plurals)); | |
1999 $this->assertTrue(in_array('2 is 2 (translated)', $plurals)); | |
2000 $this->assertTrue(in_array('3 is 0 or 3-10 (translated)', $plurals)); | |
2001 $this->assertTrue(in_array('4 is 0 or 3-10 (translated)', $plurals)); | |
2002 $this->assertTrue(in_array('5 is 0 or 3-10 (translated)', $plurals)); | |
2003 $this->assertTrue(in_array('6 is 0 or 3-10 (translated)', $plurals)); | |
2004 $this->assertTrue(in_array('7 is 0 or 3-10 (translated)', $plurals)); | |
2005 $this->assertTrue(in_array('8 is 0 or 3-10 (translated)', $plurals)); | |
2006 $this->assertTrue(in_array('9 is 0 or 3-10 (translated)', $plurals)); | |
2007 $this->assertTrue(in_array('10 is 0 or 3-10 (translated)', $plurals)); | |
2008 $this->assertTrue(in_array('11 everything else (translated)', $plurals)); | |
2009 $this->assertTrue(in_array('12 everything else (translated)', $plurals)); | |
2010 $this->assertTrue(in_array('13 everything else (translated)', $plurals)); | |
2011 $this->assertTrue(in_array('14 everything else (translated)', $plurals)); | |
2012 $this->assertTrue(in_array('15 everything else (translated)', $plurals)); | |
2013 $this->assertTrue(in_array('16 everything else (translated)', $plurals)); | |
2014 $this->assertTrue(in_array('17 everything else (translated)', $plurals)); | |
2015 $this->assertTrue(in_array('18 everything else (translated)', $plurals)); | |
2016 $this->assertTrue(in_array('19 everything else (translated)', $plurals)); | |
2017 $this->assertTrue(in_array('20 everything else (translated)', $plurals)); | |
2018 $this->assertTrue(in_array('21 everything else (translated)', $plurals)); | |
2019 $this->assertTrue(in_array('22 everything else (translated)', $plurals)); | |
2020 $this->assertTrue(in_array('23 everything else (translated)', $plurals)); | |
2021 $this->assertTrue(in_array('24 everything else (translated)', $plurals)); | |
2022 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
2023 | |
2024 $coreSingular = $this->__singularFromCore(); | |
2025 $this->assertEqual('Plural Rule 12 (from core translated)', $coreSingular); | |
2026 | |
2027 $corePlurals = $this->__pluralFromCore(); | |
2028 $this->assertTrue(in_array('0 is 0 or 3-10 (from core translated)', $corePlurals)); | |
2029 $this->assertTrue(in_array('1 is 1 (from core translated)', $corePlurals)); | |
2030 $this->assertTrue(in_array('2 is 2 (from core translated)', $corePlurals)); | |
2031 $this->assertTrue(in_array('3 is 0 or 3-10 (from core translated)', $corePlurals)); | |
2032 $this->assertTrue(in_array('4 is 0 or 3-10 (from core translated)', $corePlurals)); | |
2033 $this->assertTrue(in_array('5 is 0 or 3-10 (from core translated)', $corePlurals)); | |
2034 $this->assertTrue(in_array('6 is 0 or 3-10 (from core translated)', $corePlurals)); | |
2035 $this->assertTrue(in_array('7 is 0 or 3-10 (from core translated)', $corePlurals)); | |
2036 $this->assertTrue(in_array('8 is 0 or 3-10 (from core translated)', $corePlurals)); | |
2037 $this->assertTrue(in_array('9 is 0 or 3-10 (from core translated)', $corePlurals)); | |
2038 $this->assertTrue(in_array('10 is 0 or 3-10 (from core translated)', $corePlurals)); | |
2039 $this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals)); | |
2040 $this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals)); | |
2041 $this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals)); | |
2042 $this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals)); | |
2043 $this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals)); | |
2044 $this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals)); | |
2045 $this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals)); | |
2046 $this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals)); | |
2047 $this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals)); | |
2048 $this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals)); | |
2049 $this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals)); | |
2050 $this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals)); | |
2051 $this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals)); | |
2052 $this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals)); | |
2053 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
2054 } | |
2055 | |
2056 /** | |
2057 * testPoRulesThirteen method | |
2058 * | |
2059 * @access public | |
2060 * @return void | |
2061 */ | |
2062 function testPoRulesThirteen() { | |
2063 Configure::write('Config.language', 'rule_13_po'); | |
2064 | |
2065 $singular = $this->__singular(); | |
2066 $this->assertEqual('Plural Rule 13 (translated)', $singular); | |
2067 | |
2068 $plurals = $this->__plural(); | |
2069 $this->assertTrue(in_array('0 is 0 or ends in 01-10 (translated)', $plurals)); | |
2070 $this->assertTrue(in_array('1 is 1 (translated)', $plurals)); | |
2071 $this->assertTrue(in_array('2 is 0 or ends in 01-10 (translated)', $plurals)); | |
2072 $this->assertTrue(in_array('3 is 0 or ends in 01-10 (translated)', $plurals)); | |
2073 $this->assertTrue(in_array('4 is 0 or ends in 01-10 (translated)', $plurals)); | |
2074 $this->assertTrue(in_array('5 is 0 or ends in 01-10 (translated)', $plurals)); | |
2075 $this->assertTrue(in_array('6 is 0 or ends in 01-10 (translated)', $plurals)); | |
2076 $this->assertTrue(in_array('7 is 0 or ends in 01-10 (translated)', $plurals)); | |
2077 $this->assertTrue(in_array('8 is 0 or ends in 01-10 (translated)', $plurals)); | |
2078 $this->assertTrue(in_array('9 is 0 or ends in 01-10 (translated)', $plurals)); | |
2079 $this->assertTrue(in_array('10 is 0 or ends in 01-10 (translated)', $plurals)); | |
2080 $this->assertTrue(in_array('11 ends in 11-20 (translated)', $plurals)); | |
2081 $this->assertTrue(in_array('12 ends in 11-20 (translated)', $plurals)); | |
2082 $this->assertTrue(in_array('13 ends in 11-20 (translated)', $plurals)); | |
2083 $this->assertTrue(in_array('14 ends in 11-20 (translated)', $plurals)); | |
2084 $this->assertTrue(in_array('15 ends in 11-20 (translated)', $plurals)); | |
2085 $this->assertTrue(in_array('16 ends in 11-20 (translated)', $plurals)); | |
2086 $this->assertTrue(in_array('17 ends in 11-20 (translated)', $plurals)); | |
2087 $this->assertTrue(in_array('18 ends in 11-20 (translated)', $plurals)); | |
2088 $this->assertTrue(in_array('19 ends in 11-20 (translated)', $plurals)); | |
2089 $this->assertTrue(in_array('20 ends in 11-20 (translated)', $plurals)); | |
2090 $this->assertTrue(in_array('21 everything else (translated)', $plurals)); | |
2091 $this->assertTrue(in_array('22 everything else (translated)', $plurals)); | |
2092 $this->assertTrue(in_array('23 everything else (translated)', $plurals)); | |
2093 $this->assertTrue(in_array('24 everything else (translated)', $plurals)); | |
2094 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
2095 | |
2096 $coreSingular = $this->__singularFromCore(); | |
2097 $this->assertEqual('Plural Rule 13 (from core translated)', $coreSingular); | |
2098 | |
2099 $corePlurals = $this->__pluralFromCore(); | |
2100 $this->assertTrue(in_array('0 is 0 or ends in 01-10 (from core translated)', $corePlurals)); | |
2101 $this->assertTrue(in_array('1 is 1 (from core translated)', $corePlurals)); | |
2102 $this->assertTrue(in_array('2 is 0 or ends in 01-10 (from core translated)', $corePlurals)); | |
2103 $this->assertTrue(in_array('3 is 0 or ends in 01-10 (from core translated)', $corePlurals)); | |
2104 $this->assertTrue(in_array('4 is 0 or ends in 01-10 (from core translated)', $corePlurals)); | |
2105 $this->assertTrue(in_array('5 is 0 or ends in 01-10 (from core translated)', $corePlurals)); | |
2106 $this->assertTrue(in_array('6 is 0 or ends in 01-10 (from core translated)', $corePlurals)); | |
2107 $this->assertTrue(in_array('7 is 0 or ends in 01-10 (from core translated)', $corePlurals)); | |
2108 $this->assertTrue(in_array('8 is 0 or ends in 01-10 (from core translated)', $corePlurals)); | |
2109 $this->assertTrue(in_array('9 is 0 or ends in 01-10 (from core translated)', $corePlurals)); | |
2110 $this->assertTrue(in_array('10 is 0 or ends in 01-10 (from core translated)', $corePlurals)); | |
2111 $this->assertTrue(in_array('11 ends in 11-20 (from core translated)', $corePlurals)); | |
2112 $this->assertTrue(in_array('12 ends in 11-20 (from core translated)', $corePlurals)); | |
2113 $this->assertTrue(in_array('13 ends in 11-20 (from core translated)', $corePlurals)); | |
2114 $this->assertTrue(in_array('14 ends in 11-20 (from core translated)', $corePlurals)); | |
2115 $this->assertTrue(in_array('15 ends in 11-20 (from core translated)', $corePlurals)); | |
2116 $this->assertTrue(in_array('16 ends in 11-20 (from core translated)', $corePlurals)); | |
2117 $this->assertTrue(in_array('17 ends in 11-20 (from core translated)', $corePlurals)); | |
2118 $this->assertTrue(in_array('18 ends in 11-20 (from core translated)', $corePlurals)); | |
2119 $this->assertTrue(in_array('19 ends in 11-20 (from core translated)', $corePlurals)); | |
2120 $this->assertTrue(in_array('20 ends in 11-20 (from core translated)', $corePlurals)); | |
2121 $this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals)); | |
2122 $this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals)); | |
2123 $this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals)); | |
2124 $this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals)); | |
2125 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
2126 } | |
2127 | |
2128 /** | |
2129 * testMoRulesThirteen method | |
2130 * | |
2131 * @access public | |
2132 * @return void | |
2133 */ | |
2134 function testMoRulesThirteen() { | |
2135 Configure::write('Config.language', 'rule_13_mo'); | |
2136 | |
2137 $singular = $this->__singular(); | |
2138 $this->assertEqual('Plural Rule 13 (translated)', $singular); | |
2139 | |
2140 $plurals = $this->__plural(); | |
2141 $this->assertTrue(in_array('0 is 0 or ends in 01-10 (translated)', $plurals)); | |
2142 $this->assertTrue(in_array('1 is 1 (translated)', $plurals)); | |
2143 $this->assertTrue(in_array('2 is 0 or ends in 01-10 (translated)', $plurals)); | |
2144 $this->assertTrue(in_array('3 is 0 or ends in 01-10 (translated)', $plurals)); | |
2145 $this->assertTrue(in_array('4 is 0 or ends in 01-10 (translated)', $plurals)); | |
2146 $this->assertTrue(in_array('5 is 0 or ends in 01-10 (translated)', $plurals)); | |
2147 $this->assertTrue(in_array('6 is 0 or ends in 01-10 (translated)', $plurals)); | |
2148 $this->assertTrue(in_array('7 is 0 or ends in 01-10 (translated)', $plurals)); | |
2149 $this->assertTrue(in_array('8 is 0 or ends in 01-10 (translated)', $plurals)); | |
2150 $this->assertTrue(in_array('9 is 0 or ends in 01-10 (translated)', $plurals)); | |
2151 $this->assertTrue(in_array('10 is 0 or ends in 01-10 (translated)', $plurals)); | |
2152 $this->assertTrue(in_array('11 ends in 11-20 (translated)', $plurals)); | |
2153 $this->assertTrue(in_array('12 ends in 11-20 (translated)', $plurals)); | |
2154 $this->assertTrue(in_array('13 ends in 11-20 (translated)', $plurals)); | |
2155 $this->assertTrue(in_array('14 ends in 11-20 (translated)', $plurals)); | |
2156 $this->assertTrue(in_array('15 ends in 11-20 (translated)', $plurals)); | |
2157 $this->assertTrue(in_array('16 ends in 11-20 (translated)', $plurals)); | |
2158 $this->assertTrue(in_array('17 ends in 11-20 (translated)', $plurals)); | |
2159 $this->assertTrue(in_array('18 ends in 11-20 (translated)', $plurals)); | |
2160 $this->assertTrue(in_array('19 ends in 11-20 (translated)', $plurals)); | |
2161 $this->assertTrue(in_array('20 ends in 11-20 (translated)', $plurals)); | |
2162 $this->assertTrue(in_array('21 everything else (translated)', $plurals)); | |
2163 $this->assertTrue(in_array('22 everything else (translated)', $plurals)); | |
2164 $this->assertTrue(in_array('23 everything else (translated)', $plurals)); | |
2165 $this->assertTrue(in_array('24 everything else (translated)', $plurals)); | |
2166 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
2167 | |
2168 $coreSingular = $this->__singularFromCore(); | |
2169 $this->assertEqual('Plural Rule 13 (from core translated)', $coreSingular); | |
2170 | |
2171 $corePlurals = $this->__pluralFromCore(); | |
2172 $this->assertTrue(in_array('0 is 0 or ends in 01-10 (from core translated)', $corePlurals)); | |
2173 $this->assertTrue(in_array('1 is 1 (from core translated)', $corePlurals)); | |
2174 $this->assertTrue(in_array('2 is 0 or ends in 01-10 (from core translated)', $corePlurals)); | |
2175 $this->assertTrue(in_array('3 is 0 or ends in 01-10 (from core translated)', $corePlurals)); | |
2176 $this->assertTrue(in_array('4 is 0 or ends in 01-10 (from core translated)', $corePlurals)); | |
2177 $this->assertTrue(in_array('5 is 0 or ends in 01-10 (from core translated)', $corePlurals)); | |
2178 $this->assertTrue(in_array('6 is 0 or ends in 01-10 (from core translated)', $corePlurals)); | |
2179 $this->assertTrue(in_array('7 is 0 or ends in 01-10 (from core translated)', $corePlurals)); | |
2180 $this->assertTrue(in_array('8 is 0 or ends in 01-10 (from core translated)', $corePlurals)); | |
2181 $this->assertTrue(in_array('9 is 0 or ends in 01-10 (from core translated)', $corePlurals)); | |
2182 $this->assertTrue(in_array('10 is 0 or ends in 01-10 (from core translated)', $corePlurals)); | |
2183 $this->assertTrue(in_array('11 ends in 11-20 (from core translated)', $corePlurals)); | |
2184 $this->assertTrue(in_array('12 ends in 11-20 (from core translated)', $corePlurals)); | |
2185 $this->assertTrue(in_array('13 ends in 11-20 (from core translated)', $corePlurals)); | |
2186 $this->assertTrue(in_array('14 ends in 11-20 (from core translated)', $corePlurals)); | |
2187 $this->assertTrue(in_array('15 ends in 11-20 (from core translated)', $corePlurals)); | |
2188 $this->assertTrue(in_array('16 ends in 11-20 (from core translated)', $corePlurals)); | |
2189 $this->assertTrue(in_array('17 ends in 11-20 (from core translated)', $corePlurals)); | |
2190 $this->assertTrue(in_array('18 ends in 11-20 (from core translated)', $corePlurals)); | |
2191 $this->assertTrue(in_array('19 ends in 11-20 (from core translated)', $corePlurals)); | |
2192 $this->assertTrue(in_array('20 ends in 11-20 (from core translated)', $corePlurals)); | |
2193 $this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals)); | |
2194 $this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals)); | |
2195 $this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals)); | |
2196 $this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals)); | |
2197 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
2198 } | |
2199 | |
2200 /** | |
2201 * testPoRulesFourteen method | |
2202 * | |
2203 * @access public | |
2204 * @return void | |
2205 */ | |
2206 function testPoRulesFourteen() { | |
2207 Configure::write('Config.language', 'rule_14_po'); | |
2208 | |
2209 $singular = $this->__singular(); | |
2210 $this->assertEqual('Plural Rule 14 (translated)', $singular); | |
2211 | |
2212 $plurals = $this->__plural(); | |
2213 $this->assertTrue(in_array('0 everything else (translated)', $plurals)); | |
2214 $this->assertTrue(in_array('1 ends in 1 (translated)', $plurals)); | |
2215 $this->assertTrue(in_array('2 ends in 2 (translated)', $plurals)); | |
2216 $this->assertTrue(in_array('3 everything else (translated)', $plurals)); | |
2217 $this->assertTrue(in_array('4 everything else (translated)', $plurals)); | |
2218 $this->assertTrue(in_array('5 everything else (translated)', $plurals)); | |
2219 $this->assertTrue(in_array('6 everything else (translated)', $plurals)); | |
2220 $this->assertTrue(in_array('7 everything else (translated)', $plurals)); | |
2221 $this->assertTrue(in_array('8 everything else (translated)', $plurals)); | |
2222 $this->assertTrue(in_array('9 everything else (translated)', $plurals)); | |
2223 $this->assertTrue(in_array('10 everything else (translated)', $plurals)); | |
2224 $this->assertTrue(in_array('11 ends in 1 (translated)', $plurals)); | |
2225 $this->assertTrue(in_array('12 ends in 2 (translated)', $plurals)); | |
2226 $this->assertTrue(in_array('13 everything else (translated)', $plurals)); | |
2227 $this->assertTrue(in_array('14 everything else (translated)', $plurals)); | |
2228 $this->assertTrue(in_array('15 everything else (translated)', $plurals)); | |
2229 $this->assertTrue(in_array('16 everything else (translated)', $plurals)); | |
2230 $this->assertTrue(in_array('17 everything else (translated)', $plurals)); | |
2231 $this->assertTrue(in_array('18 everything else (translated)', $plurals)); | |
2232 $this->assertTrue(in_array('19 everything else (translated)', $plurals)); | |
2233 $this->assertTrue(in_array('20 everything else (translated)', $plurals)); | |
2234 $this->assertTrue(in_array('21 ends in 1 (translated)', $plurals)); | |
2235 $this->assertTrue(in_array('22 ends in 2 (translated)', $plurals)); | |
2236 $this->assertTrue(in_array('23 everything else (translated)', $plurals)); | |
2237 $this->assertTrue(in_array('24 everything else (translated)', $plurals)); | |
2238 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
2239 | |
2240 $coreSingular = $this->__singularFromCore(); | |
2241 $this->assertEqual('Plural Rule 14 (from core translated)', $coreSingular); | |
2242 | |
2243 $corePlurals = $this->__pluralFromCore(); | |
2244 $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); | |
2245 $this->assertTrue(in_array('1 ends in 1 (from core translated)', $corePlurals)); | |
2246 $this->assertTrue(in_array('2 ends in 2 (from core translated)', $corePlurals)); | |
2247 $this->assertTrue(in_array('3 everything else (from core translated)', $corePlurals)); | |
2248 $this->assertTrue(in_array('4 everything else (from core translated)', $corePlurals)); | |
2249 $this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals)); | |
2250 $this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals)); | |
2251 $this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals)); | |
2252 $this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals)); | |
2253 $this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals)); | |
2254 $this->assertTrue(in_array('10 everything else (from core translated)', $corePlurals)); | |
2255 $this->assertTrue(in_array('11 ends in 1 (from core translated)', $corePlurals)); | |
2256 $this->assertTrue(in_array('12 ends in 2 (from core translated)', $corePlurals)); | |
2257 $this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals)); | |
2258 $this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals)); | |
2259 $this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals)); | |
2260 $this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals)); | |
2261 $this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals)); | |
2262 $this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals)); | |
2263 $this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals)); | |
2264 $this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals)); | |
2265 $this->assertTrue(in_array('21 ends in 1 (from core translated)', $corePlurals)); | |
2266 $this->assertTrue(in_array('22 ends in 2 (from core translated)', $corePlurals)); | |
2267 $this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals)); | |
2268 $this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals)); | |
2269 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
2270 } | |
2271 | |
2272 /** | |
2273 * testMoRulesFourteen method | |
2274 * | |
2275 * @access public | |
2276 * @return void | |
2277 */ | |
2278 function testMoRulesFourteen() { | |
2279 Configure::write('Config.language', 'rule_14_mo'); | |
2280 | |
2281 $singular = $this->__singular(); | |
2282 $this->assertEqual('Plural Rule 14 (translated)', $singular); | |
2283 | |
2284 $plurals = $this->__plural(); | |
2285 $this->assertTrue(in_array('0 everything else (translated)', $plurals)); | |
2286 $this->assertTrue(in_array('1 ends in 1 (translated)', $plurals)); | |
2287 $this->assertTrue(in_array('2 ends in 2 (translated)', $plurals)); | |
2288 $this->assertTrue(in_array('3 everything else (translated)', $plurals)); | |
2289 $this->assertTrue(in_array('4 everything else (translated)', $plurals)); | |
2290 $this->assertTrue(in_array('5 everything else (translated)', $plurals)); | |
2291 $this->assertTrue(in_array('6 everything else (translated)', $plurals)); | |
2292 $this->assertTrue(in_array('7 everything else (translated)', $plurals)); | |
2293 $this->assertTrue(in_array('8 everything else (translated)', $plurals)); | |
2294 $this->assertTrue(in_array('9 everything else (translated)', $plurals)); | |
2295 $this->assertTrue(in_array('10 everything else (translated)', $plurals)); | |
2296 $this->assertTrue(in_array('11 ends in 1 (translated)', $plurals)); | |
2297 $this->assertTrue(in_array('12 ends in 2 (translated)', $plurals)); | |
2298 $this->assertTrue(in_array('13 everything else (translated)', $plurals)); | |
2299 $this->assertTrue(in_array('14 everything else (translated)', $plurals)); | |
2300 $this->assertTrue(in_array('15 everything else (translated)', $plurals)); | |
2301 $this->assertTrue(in_array('16 everything else (translated)', $plurals)); | |
2302 $this->assertTrue(in_array('17 everything else (translated)', $plurals)); | |
2303 $this->assertTrue(in_array('18 everything else (translated)', $plurals)); | |
2304 $this->assertTrue(in_array('19 everything else (translated)', $plurals)); | |
2305 $this->assertTrue(in_array('20 everything else (translated)', $plurals)); | |
2306 $this->assertTrue(in_array('21 ends in 1 (translated)', $plurals)); | |
2307 $this->assertTrue(in_array('22 ends in 2 (translated)', $plurals)); | |
2308 $this->assertTrue(in_array('23 everything else (translated)', $plurals)); | |
2309 $this->assertTrue(in_array('24 everything else (translated)', $plurals)); | |
2310 $this->assertTrue(in_array('25 everything else (translated)', $plurals)); | |
2311 | |
2312 $coreSingular = $this->__singularFromCore(); | |
2313 $this->assertEqual('Plural Rule 14 (from core translated)', $coreSingular); | |
2314 | |
2315 $corePlurals = $this->__pluralFromCore(); | |
2316 $this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals)); | |
2317 $this->assertTrue(in_array('1 ends in 1 (from core translated)', $corePlurals)); | |
2318 $this->assertTrue(in_array('2 ends in 2 (from core translated)', $corePlurals)); | |
2319 $this->assertTrue(in_array('3 everything else (from core translated)', $corePlurals)); | |
2320 $this->assertTrue(in_array('4 everything else (from core translated)', $corePlurals)); | |
2321 $this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals)); | |
2322 $this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals)); | |
2323 $this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals)); | |
2324 $this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals)); | |
2325 $this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals)); | |
2326 $this->assertTrue(in_array('10 everything else (from core translated)', $corePlurals)); | |
2327 $this->assertTrue(in_array('11 ends in 1 (from core translated)', $corePlurals)); | |
2328 $this->assertTrue(in_array('12 ends in 2 (from core translated)', $corePlurals)); | |
2329 $this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals)); | |
2330 $this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals)); | |
2331 $this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals)); | |
2332 $this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals)); | |
2333 $this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals)); | |
2334 $this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals)); | |
2335 $this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals)); | |
2336 $this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals)); | |
2337 $this->assertTrue(in_array('21 ends in 1 (from core translated)', $corePlurals)); | |
2338 $this->assertTrue(in_array('22 ends in 2 (from core translated)', $corePlurals)); | |
2339 $this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals)); | |
2340 $this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals)); | |
2341 $this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals)); | |
2342 } | |
2343 | |
2344 /** | |
2345 * testSetLanguageWithSession method | |
2346 * | |
2347 * @access public | |
2348 * @return void | |
2349 */ | |
2350 function testSetLanguageWithSession () { | |
2351 $_SESSION['Config']['language'] = 'po'; | |
2352 $singular = $this->__singular(); | |
2353 $this->assertEqual('Po (translated)', $singular); | |
2354 | |
2355 $plurals = $this->__plural(); | |
2356 $this->assertTrue(in_array('0 everything else (po translated)', $plurals)); | |
2357 $this->assertTrue(in_array('1 is 1 (po translated)', $plurals)); | |
2358 $this->assertTrue(in_array('2 is 2-4 (po translated)', $plurals)); | |
2359 $this->assertTrue(in_array('3 is 2-4 (po translated)', $plurals)); | |
2360 $this->assertTrue(in_array('4 is 2-4 (po translated)', $plurals)); | |
2361 $this->assertTrue(in_array('5 everything else (po translated)', $plurals)); | |
2362 $this->assertTrue(in_array('6 everything else (po translated)', $plurals)); | |
2363 $this->assertTrue(in_array('7 everything else (po translated)', $plurals)); | |
2364 $this->assertTrue(in_array('8 everything else (po translated)', $plurals)); | |
2365 $this->assertTrue(in_array('9 everything else (po translated)', $plurals)); | |
2366 $this->assertTrue(in_array('10 everything else (po translated)', $plurals)); | |
2367 $this->assertTrue(in_array('11 everything else (po translated)', $plurals)); | |
2368 $this->assertTrue(in_array('12 everything else (po translated)', $plurals)); | |
2369 $this->assertTrue(in_array('13 everything else (po translated)', $plurals)); | |
2370 $this->assertTrue(in_array('14 everything else (po translated)', $plurals)); | |
2371 $this->assertTrue(in_array('15 everything else (po translated)', $plurals)); | |
2372 $this->assertTrue(in_array('16 everything else (po translated)', $plurals)); | |
2373 $this->assertTrue(in_array('17 everything else (po translated)', $plurals)); | |
2374 $this->assertTrue(in_array('18 everything else (po translated)', $plurals)); | |
2375 $this->assertTrue(in_array('19 everything else (po translated)', $plurals)); | |
2376 $this->assertTrue(in_array('20 everything else (po translated)', $plurals)); | |
2377 $this->assertTrue(in_array('21 everything else (po translated)', $plurals)); | |
2378 $this->assertTrue(in_array('22 everything else (po translated)', $plurals)); | |
2379 $this->assertTrue(in_array('23 everything else (po translated)', $plurals)); | |
2380 $this->assertTrue(in_array('24 everything else (po translated)', $plurals)); | |
2381 $this->assertTrue(in_array('25 everything else (po translated)', $plurals)); | |
2382 unset($_SESSION['Config']['language']); | |
2383 } | |
2384 | |
2385 /** | |
2386 * testNoCoreTranslation method | |
2387 * | |
2388 * @access public | |
2389 * @return void | |
2390 */ | |
2391 function testNoCoreTranslation () { | |
2392 Configure::write('Config.language', 'po'); | |
2393 $singular = $this->__singular(); | |
2394 $this->assertEqual('Po (translated)', $singular); | |
2395 | |
2396 $coreSingular = $this->__singularFromCore(); | |
2397 $this->assertNotEqual('Po (from core translated)', $coreSingular); | |
2398 | |
2399 $corePlurals = $this->__pluralFromCore(); | |
2400 $this->assertFalse(in_array('0 everything else (from core translated)', $corePlurals)); | |
2401 $this->assertFalse(in_array('1 is 1 (from core translated)', $corePlurals)); | |
2402 $this->assertFalse(in_array('2 is 2-4 (from core translated)', $corePlurals)); | |
2403 $this->assertFalse(in_array('3 is 2-4 (from core translated)', $corePlurals)); | |
2404 $this->assertFalse(in_array('4 is 2-4 (from core translated)', $corePlurals)); | |
2405 $this->assertFalse(in_array('5 everything else (from core translated)', $corePlurals)); | |
2406 $this->assertFalse(in_array('6 everything else (from core translated)', $corePlurals)); | |
2407 $this->assertFalse(in_array('7 everything else (from core translated)', $corePlurals)); | |
2408 $this->assertFalse(in_array('8 everything else (from core translated)', $corePlurals)); | |
2409 $this->assertFalse(in_array('9 everything else (from core translated)', $corePlurals)); | |
2410 $this->assertFalse(in_array('10 everything else (from core translated)', $corePlurals)); | |
2411 $this->assertFalse(in_array('11 everything else (from core translated)', $corePlurals)); | |
2412 $this->assertFalse(in_array('12 everything else (from core translated)', $corePlurals)); | |
2413 $this->assertFalse(in_array('13 everything else (from core translated)', $corePlurals)); | |
2414 $this->assertFalse(in_array('14 everything else (from core translated)', $corePlurals)); | |
2415 $this->assertFalse(in_array('15 everything else (from core translated)', $corePlurals)); | |
2416 $this->assertFalse(in_array('16 everything else (from core translated)', $corePlurals)); | |
2417 $this->assertFalse(in_array('17 everything else (from core translated)', $corePlurals)); | |
2418 $this->assertFalse(in_array('18 everything else (from core translated)', $corePlurals)); | |
2419 $this->assertFalse(in_array('19 everything else (from core translated)', $corePlurals)); | |
2420 $this->assertFalse(in_array('20 everything else (from core translated)', $corePlurals)); | |
2421 $this->assertFalse(in_array('21 everything else (from core translated)', $corePlurals)); | |
2422 $this->assertFalse(in_array('22 everything else (from core translated)', $corePlurals)); | |
2423 $this->assertFalse(in_array('23 everything else (from core translated)', $corePlurals)); | |
2424 $this->assertFalse(in_array('24 everything else (from core translated)', $corePlurals)); | |
2425 $this->assertFalse(in_array('25 everything else (from core translated)', $corePlurals)); | |
2426 } | |
2427 | |
2428 /** | |
2429 * testPluginTranslation method | |
2430 * | |
2431 * @access public | |
2432 * @return void | |
2433 */ | |
2434 function testPluginTranslation() { | |
2435 App::build(array( | |
2436 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS) | |
2437 )); | |
2438 | |
2439 Configure::write('Config.language', 'po'); | |
2440 $singular = $this->__domainSingular(); | |
2441 $this->assertEqual('Plural Rule 1 (from plugin)', $singular); | |
2442 | |
2443 $plurals = $this->__domainPlural(); | |
2444 $this->assertTrue(in_array('0 = 0 or > 1 (from plugin)', $plurals)); | |
2445 $this->assertTrue(in_array('1 = 1 (from plugin)', $plurals)); | |
2446 $this->assertTrue(in_array('2 = 0 or > 1 (from plugin)', $plurals)); | |
2447 $this->assertTrue(in_array('3 = 0 or > 1 (from plugin)', $plurals)); | |
2448 $this->assertTrue(in_array('4 = 0 or > 1 (from plugin)', $plurals)); | |
2449 $this->assertTrue(in_array('5 = 0 or > 1 (from plugin)', $plurals)); | |
2450 $this->assertTrue(in_array('6 = 0 or > 1 (from plugin)', $plurals)); | |
2451 $this->assertTrue(in_array('7 = 0 or > 1 (from plugin)', $plurals)); | |
2452 $this->assertTrue(in_array('8 = 0 or > 1 (from plugin)', $plurals)); | |
2453 $this->assertTrue(in_array('9 = 0 or > 1 (from plugin)', $plurals)); | |
2454 $this->assertTrue(in_array('10 = 0 or > 1 (from plugin)', $plurals)); | |
2455 $this->assertTrue(in_array('11 = 0 or > 1 (from plugin)', $plurals)); | |
2456 $this->assertTrue(in_array('12 = 0 or > 1 (from plugin)', $plurals)); | |
2457 $this->assertTrue(in_array('13 = 0 or > 1 (from plugin)', $plurals)); | |
2458 $this->assertTrue(in_array('14 = 0 or > 1 (from plugin)', $plurals)); | |
2459 $this->assertTrue(in_array('15 = 0 or > 1 (from plugin)', $plurals)); | |
2460 $this->assertTrue(in_array('16 = 0 or > 1 (from plugin)', $plurals)); | |
2461 $this->assertTrue(in_array('17 = 0 or > 1 (from plugin)', $plurals)); | |
2462 $this->assertTrue(in_array('18 = 0 or > 1 (from plugin)', $plurals)); | |
2463 $this->assertTrue(in_array('19 = 0 or > 1 (from plugin)', $plurals)); | |
2464 $this->assertTrue(in_array('20 = 0 or > 1 (from plugin)', $plurals)); | |
2465 $this->assertTrue(in_array('21 = 0 or > 1 (from plugin)', $plurals)); | |
2466 $this->assertTrue(in_array('22 = 0 or > 1 (from plugin)', $plurals)); | |
2467 $this->assertTrue(in_array('23 = 0 or > 1 (from plugin)', $plurals)); | |
2468 $this->assertTrue(in_array('24 = 0 or > 1 (from plugin)', $plurals)); | |
2469 $this->assertTrue(in_array('25 = 0 or > 1 (from plugin)', $plurals)); | |
2470 } | |
2471 | |
2472 /** | |
2473 * testPoMultipleLineTranslation method | |
2474 * | |
2475 * @access public | |
2476 * @return void | |
2477 */ | |
2478 function testPoMultipleLineTranslation () { | |
2479 Configure::write('Config.language', 'po'); | |
2480 | |
2481 $string = "This is a multiline translation\n"; | |
2482 $string .= "broken up over multiple lines.\n"; | |
2483 $string .= "This is the third line.\n"; | |
2484 $string .= "This is the forth line."; | |
2485 $result = __($string, true); | |
2486 | |
2487 $expected = "This is a multiline translation\n"; | |
2488 $expected .= "broken up over multiple lines.\n"; | |
2489 $expected .= "This is the third line.\n"; | |
2490 $expected .= "This is the forth line. (translated)"; | |
2491 $this->assertEqual($result, $expected); | |
2492 | |
2493 // Windows Newline is \r\n | |
2494 $string = "This is a multiline translation\r\n"; | |
2495 $string .= "broken up over multiple lines.\r\n"; | |
2496 $string .= "This is the third line.\r\n"; | |
2497 $string .= "This is the forth line."; | |
2498 $result = __($string, true); | |
2499 $this->assertEqual($result, $expected); | |
2500 | |
2501 $singular = "valid\nsecond line"; | |
2502 $plural = "valids\nsecond line"; | |
2503 | |
2504 $result = __n($singular, $plural, 1, true); | |
2505 $expected = "v\nsecond line"; | |
2506 $this->assertEqual($result, $expected); | |
2507 | |
2508 $result = __n($singular, $plural, 2, true); | |
2509 $expected = "vs\nsecond line"; | |
2510 $this->assertEqual($result, $expected); | |
2511 | |
2512 $string = "This is a multiline translation\n"; | |
2513 $string .= "broken up over multiple lines.\n"; | |
2514 $string .= "This is the third line.\n"; | |
2515 $string .= "This is the forth line."; | |
2516 | |
2517 $singular = "%d = 1\n" . $string; | |
2518 $plural = "%d = 0 or > 1\n" . $string; | |
2519 | |
2520 $result = __n($singular, $plural, 1, true); | |
2521 $expected = "%d is 1\n" . $string; | |
2522 $this->assertEqual($result, $expected); | |
2523 | |
2524 $result = __n($singular, $plural, 2, true); | |
2525 $expected = "%d is 2-4\n" . $string; | |
2526 $this->assertEqual($result, $expected); | |
2527 | |
2528 // Windows Newline is \r\n | |
2529 $string = "This is a multiline translation\r\n"; | |
2530 $string .= "broken up over multiple lines.\r\n"; | |
2531 $string .= "This is the third line.\r\n"; | |
2532 $string .= "This is the forth line."; | |
2533 | |
2534 $singular = "%d = 1\r\n" . $string; | |
2535 $plural = "%d = 0 or > 1\r\n" . $string; | |
2536 | |
2537 $result = __n($singular, $plural, 1, true); | |
2538 $expected = "%d is 1\n" . str_replace("\r\n", "\n", $string); | |
2539 $this->assertEqual($result, $expected); | |
2540 | |
2541 $result = __n($singular, $plural, 2, true); | |
2542 $expected = "%d is 2-4\n" . str_replace("\r\n", "\n", $string); | |
2543 $this->assertEqual($result, $expected); | |
2544 } | |
2545 | |
2546 /** | |
2547 * testPoNoTranslationNeeded method | |
2548 * | |
2549 * @access public | |
2550 * @return void | |
2551 */ | |
2552 function testPoNoTranslationNeeded () { | |
2553 Configure::write('Config.language', 'po'); | |
2554 $result = __('No Translation needed', true); | |
2555 $this->assertEqual($result, 'No Translation needed'); | |
2556 } | |
2557 | |
2558 /** | |
2559 * testPoQuotedString method | |
2560 * | |
2561 * @access public | |
2562 * @return void | |
2563 */ | |
2564 function testPoQuotedString () { | |
2565 $expected = 'this is a "quoted string" (translated)'; | |
2566 $this->assertEqual(__('this is a "quoted string"', true), $expected); | |
2567 } | |
2568 | |
2569 /** | |
2570 * testFloatValue method | |
2571 * | |
2572 * @access public | |
2573 * @return void | |
2574 */ | |
2575 function testFloatValue() { | |
2576 Configure::write('Config.language', 'rule_9_po'); | |
2577 | |
2578 $result = __n('%d = 1', '%d = 0 or > 1', (float)1, true); | |
2579 $expected = '%d is 1 (translated)'; | |
2580 $this->assertEqual($result, $expected); | |
2581 | |
2582 $result = __n('%d = 1', '%d = 0 or > 1', (float)2, true); | |
2583 $expected = "%d ends in 2-4, not 12-14 (translated)"; | |
2584 $this->assertEqual($result, $expected); | |
2585 | |
2586 $result = __n('%d = 1', '%d = 0 or > 1', (float)5, true); | |
2587 $expected = "%d everything else (translated)"; | |
2588 $this->assertEqual($result, $expected); | |
2589 } | |
2590 | |
2591 /** | |
2592 * testCategory method | |
2593 * | |
2594 * @access public | |
2595 * @return void | |
2596 */ | |
2597 function testCategory() { | |
2598 Configure::write('Config.language', 'po'); | |
2599 $category = $this->__category(); | |
2600 $this->assertEqual('Monetary Po (translated)', $category); | |
2601 } | |
2602 | |
2603 /** | |
2604 * testPluginCategory method | |
2605 * | |
2606 * @access public | |
2607 * @return void | |
2608 */ | |
2609 function testPluginCategory() { | |
2610 Configure::write('Config.language', 'po'); | |
2611 | |
2612 $singular = $this->__domainCategorySingular(); | |
2613 $this->assertEqual('Monetary Plural Rule 1 (from plugin)', $singular); | |
2614 | |
2615 $plurals = $this->__domainCategoryPlural(); | |
2616 $this->assertTrue(in_array('Monetary 0 = 0 or > 1 (from plugin)', $plurals)); | |
2617 $this->assertTrue(in_array('Monetary 1 = 1 (from plugin)', $plurals)); | |
2618 } | |
2619 | |
2620 /** | |
2621 * testCategoryThenSingular method | |
2622 * | |
2623 * @access public | |
2624 * @return void | |
2625 */ | |
2626 function testCategoryThenSingular() { | |
2627 Configure::write('Config.language', 'po'); | |
2628 $category = $this->__category(); | |
2629 $this->assertEqual('Monetary Po (translated)', $category); | |
2630 | |
2631 $singular = $this->__singular(); | |
2632 $this->assertEqual('Po (translated)', $singular); | |
2633 } | |
2634 | |
2635 function testTimeDefinition() { | |
2636 Configure::write('Config.language', 'po'); | |
2637 $result = __c('d_fmt', 5, true); | |
2638 $expected = '%m/%d/%Y'; | |
2639 $this->assertEqual($result, $expected); | |
2640 | |
2641 $result = __c('am_pm', 5, true); | |
2642 $expected = array('AM', 'PM'); | |
2643 $this->assertEqual($result, $expected); | |
2644 | |
2645 $result = __c('abmon', 5, true); | |
2646 $expected = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); | |
2647 $this->assertEqual($result, $expected); | |
2648 } | |
2649 | |
2650 function testTimeDefinitionJapanese(){ | |
2651 Configure::write('Config.language', 'ja_jp'); | |
2652 $result = __c('d_fmt', 5, true); | |
2653 | |
2654 $expected = "%Y年%m月%d日"; | |
2655 | |
2656 $this->assertEqual($result, $expected); | |
2657 | |
2658 $result = __c('am_pm', 5, true); | |
2659 $expected = array("午前", "午後"); | |
2660 $this->assertEqual($result, $expected); | |
2661 | |
2662 $result = __c('abmon', 5, true); | |
2663 $expected = array(" 1月", " 2月", " 3月", " 4月", " 5月", " 6月", " 7月", " 8月", " 9月", "10月", "11月", "12月"); | |
2664 $this->assertEqual($result, $expected); | |
2665 } | |
2666 | |
2667 /** | |
2668 * Singular method | |
2669 * | |
2670 * @access private | |
2671 * @return void | |
2672 */ | |
2673 function __domainCategorySingular($domain = 'test_plugin', $category = 3) { | |
2674 $singular = __dc($domain, 'Plural Rule 1', $category, true); | |
2675 return $singular; | |
2676 } | |
2677 | |
2678 /** | |
2679 * Plural method | |
2680 * | |
2681 * @access private | |
2682 * @return void | |
2683 */ | |
2684 function __domainCategoryPlural($domain = 'test_plugin', $category = 3) { | |
2685 $plurals = array(); | |
2686 for ($number = 0; $number <= 25; $number++) { | |
2687 $plurals[] = sprintf(__dcn($domain, '%d = 1', '%d = 0 or > 1', (float)$number, $category, true), (float)$number); | |
2688 } | |
2689 return $plurals; | |
2690 } | |
2691 | |
2692 /** | |
2693 * Singular method | |
2694 * | |
2695 * @access private | |
2696 * @return void | |
2697 */ | |
2698 function __domainSingular($domain = 'test_plugin') { | |
2699 $singular = __d($domain, 'Plural Rule 1', true); | |
2700 return $singular; | |
2701 } | |
2702 | |
2703 /** | |
2704 * Plural method | |
2705 * | |
2706 * @access private | |
2707 * @return void | |
2708 */ | |
2709 function __domainPlural($domain = 'test_plugin') { | |
2710 $plurals = array(); | |
2711 for ($number = 0; $number <= 25; $number++) { | |
2712 $plurals[] = sprintf(__dn($domain, '%d = 1', '%d = 0 or > 1', (float)$number, true), (float)$number ); | |
2713 } | |
2714 return $plurals; | |
2715 } | |
2716 | |
2717 /** | |
2718 * category method | |
2719 * | |
2720 * @access private | |
2721 * @return void | |
2722 */ | |
2723 function __category($category = 3) { | |
2724 $singular = __c('Plural Rule 1', $category, true); | |
2725 return $singular; | |
2726 } | |
2727 | |
2728 /** | |
2729 * Singular method | |
2730 * | |
2731 * @access private | |
2732 * @return void | |
2733 */ | |
2734 function __singular() { | |
2735 $singular = __('Plural Rule 1', true); | |
2736 return $singular; | |
2737 } | |
2738 | |
2739 /** | |
2740 * Plural method | |
2741 * | |
2742 * @access private | |
2743 * @return void | |
2744 */ | |
2745 function __plural() { | |
2746 $plurals = array(); | |
2747 for ($number = 0; $number <= 25; $number++) { | |
2748 $plurals[] = sprintf(__n('%d = 1', '%d = 0 or > 1', (float)$number, true), (float)$number ); | |
2749 } | |
2750 return $plurals; | |
2751 } | |
2752 | |
2753 /** | |
2754 * singularFromCore method | |
2755 * | |
2756 * @access private | |
2757 * @return void | |
2758 */ | |
2759 function __singularFromCore() { | |
2760 $singular = __('Plural Rule 1 (from core)', true); | |
2761 return $singular; | |
2762 } | |
2763 | |
2764 /** | |
2765 * pluralFromCore method | |
2766 * | |
2767 * @access private | |
2768 * @return void | |
2769 */ | |
2770 function __pluralFromCore() { | |
2771 $plurals = array(); | |
2772 for ($number = 0; $number <= 25; $number++) { | |
2773 $plurals[] = sprintf(__n('%d = 1 (from core)', '%d = 0 or > 1 (from core)', (float)$number, true), (float)$number ); | |
2774 } | |
2775 return $plurals; | |
2776 } | |
2777 } |