2008-05-30 11:40:08 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2009-03-18 17:55:58 +00:00
|
|
|
* I18nTest file
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2012-04-27 02:49:18 +00:00
|
|
|
* CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
|
2013-02-08 11:59:49 +00:00
|
|
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2010-10-03 16:31:21 +00:00
|
|
|
* Licensed under The MIT License
|
2013-02-08 12:22:51 +00:00
|
|
|
* For full copyright and license information, please see the LICENSE.txt
|
2010-10-03 16:31:21 +00:00
|
|
|
* Redistributions of files must retain the above copyright notice
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2013-02-08 11:59:49 +00:00
|
|
|
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2012-04-27 02:49:18 +00:00
|
|
|
* @link http://book.cakephp.org/2.0/en/development/testing.html CakePHP(tm) Tests
|
2011-07-26 06:16:14 +00:00
|
|
|
* @package Cake.Test.Case.I18n
|
2008-10-30 17:30:26 +00:00
|
|
|
* @since CakePHP(tm) v 1.2.0.5432
|
2013-05-30 22:11:14 +00:00
|
|
|
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
2013-05-30 22:11:14 +00:00
|
|
|
|
2010-12-09 05:55:24 +00:00
|
|
|
App::uses('I18n', 'I18n');
|
2014-01-20 07:56:35 +00:00
|
|
|
App::uses('CakeSession', 'Model/Datasource');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2009-03-18 17:55:58 +00:00
|
|
|
* I18nTest class
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2011-07-26 06:16:14 +00:00
|
|
|
* @package Cake.Test.Case.I18n
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
2008-07-21 02:40:58 +00:00
|
|
|
class I18nTest extends CakeTestCase {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* setUp method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function setUp() {
|
2012-08-11 20:43:10 +00:00
|
|
|
parent::setUp();
|
|
|
|
|
2009-07-26 01:27:02 +00:00
|
|
|
Cache::delete('object_map', '_cake_core_');
|
2009-06-11 16:13:16 +00:00
|
|
|
App::build(array(
|
2012-02-18 12:31:29 +00:00
|
|
|
'Locale' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Locale' . DS),
|
|
|
|
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
2012-02-18 12:04:54 +00:00
|
|
|
), App::RESET);
|
2012-02-17 03:59:24 +00:00
|
|
|
CakePlugin::load(array('TestPlugin'));
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-03-21 23:55:39 +00:00
|
|
|
/**
|
|
|
|
* tearDown method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function tearDown() {
|
2012-08-11 20:58:12 +00:00
|
|
|
parent::tearDown();
|
|
|
|
|
2009-07-26 01:27:02 +00:00
|
|
|
Cache::delete('object_map', '_cake_core_');
|
2009-06-11 16:13:16 +00:00
|
|
|
App::build();
|
2011-05-09 05:06:52 +00:00
|
|
|
CakePlugin::unload();
|
2009-03-21 23:55:39 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2012-01-09 19:49:26 +00:00
|
|
|
/**
|
|
|
|
* testTranslationCaching method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testTranslationCaching() {
|
2010-09-14 02:17:05 +00:00
|
|
|
Configure::write('Config.language', 'cache_test_po');
|
2010-09-21 18:45:57 +00:00
|
|
|
|
2010-09-18 15:34:46 +00:00
|
|
|
// reset internally stored entries
|
2010-09-22 01:13:45 +00:00
|
|
|
I18n::clear();
|
|
|
|
|
2010-09-14 02:17:05 +00:00
|
|
|
Cache::clear(false, '_cake_core_');
|
2012-02-16 18:28:21 +00:00
|
|
|
$lang = Configure::read('Config.language');
|
2010-09-14 02:17:05 +00:00
|
|
|
|
|
|
|
Cache::config('_cake_core_', Cache::config('default'));
|
|
|
|
|
|
|
|
// make some calls to translate using different domains
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Dom 1 Foo', I18n::translate('dom1.foo', false, 'dom1'));
|
|
|
|
$this->assertEquals('Dom 1 Bar', I18n::translate('dom1.bar', false, 'dom1'));
|
2010-09-25 03:27:22 +00:00
|
|
|
$domains = I18n::domains();
|
2014-06-08 09:54:28 +00:00
|
|
|
$this->assertEquals('Dom 1 Foo', $domains['dom1']['cache_test_po']['LC_MESSAGES']['dom1.foo']['']);
|
2010-09-14 02:17:05 +00:00
|
|
|
|
2010-09-18 15:34:46 +00:00
|
|
|
// reset internally stored entries
|
2010-09-22 01:13:45 +00:00
|
|
|
I18n::clear();
|
2010-09-14 02:17:05 +00:00
|
|
|
|
|
|
|
// now only dom1 should be in cache
|
|
|
|
$cachedDom1 = Cache::read('dom1_' . $lang, '_cake_core_');
|
2014-06-08 09:54:28 +00:00
|
|
|
$this->assertEquals('Dom 1 Foo', $cachedDom1['LC_MESSAGES']['dom1.foo']['']);
|
|
|
|
$this->assertEquals('Dom 1 Bar', $cachedDom1['LC_MESSAGES']['dom1.bar']['']);
|
2010-09-14 02:17:05 +00:00
|
|
|
// dom2 not in cache
|
|
|
|
$this->assertFalse(Cache::read('dom2_' . $lang, '_cake_core_'));
|
|
|
|
|
|
|
|
// translate a item of dom2 (adds dom2 to cache)
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Dom 2 Foo', I18n::translate('dom2.foo', false, 'dom2'));
|
2010-09-14 02:17:05 +00:00
|
|
|
|
2010-09-21 18:45:57 +00:00
|
|
|
// verify dom2 was cached through manual read from cache
|
2010-09-14 02:17:05 +00:00
|
|
|
$cachedDom2 = Cache::read('dom2_' . $lang, '_cake_core_');
|
2014-06-08 09:54:28 +00:00
|
|
|
$this->assertEquals('Dom 2 Foo', $cachedDom2['LC_MESSAGES']['dom2.foo']['']);
|
|
|
|
$this->assertEquals('Dom 2 Bar', $cachedDom2['LC_MESSAGES']['dom2.bar']['']);
|
2010-09-21 18:45:57 +00:00
|
|
|
|
2011-04-17 10:35:21 +00:00
|
|
|
// modify cache entry manually to verify that dom1 entries now will be read from cache
|
2014-06-08 09:54:28 +00:00
|
|
|
$cachedDom1['LC_MESSAGES']['dom1.foo'][''] = 'FOO';
|
2010-09-21 18:45:57 +00:00
|
|
|
Cache::write('dom1_' . $lang, $cachedDom1, '_cake_core_');
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('FOO', I18n::translate('dom1.foo', false, 'dom1'));
|
2010-09-14 02:17:05 +00:00
|
|
|
}
|
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testDefaultStrings method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testDefaultStrings() {
|
2013-07-22 19:08:05 +00:00
|
|
|
$singular = $this->_singular();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Plural Rule 1', $singular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$plurals = $this->_plural();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('1 = 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('2 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('3 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('4 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('5 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('6 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('7 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('8 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('9 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('10 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('11 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('12 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('13 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('14 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('15 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('16 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('17 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('18 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('19 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('20 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('21 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('22 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('23 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('24 = 0 or > 1', $plurals));
|
|
|
|
$this->assertTrue(in_array('25 = 0 or > 1', $plurals));
|
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$coreSingular = $this->_singularFromCore();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Plural Rule 1 (from core)', $coreSingular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$corePlurals = $this->_pluralFromCore();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('1 = 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('2 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('3 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('4 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('5 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('6 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('7 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('8 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('9 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('10 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('11 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('12 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('13 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('14 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('15 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('16 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('17 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('18 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('19 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('20 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('21 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('22 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('23 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('24 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('25 = 0 or > 1 (from core)', $corePlurals));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testPoRulesZero method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testPoRulesZero() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_0_po');
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertRulesZero();
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testMoRulesZero method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testMoRulesZero() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_0_mo');
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertRulesZero();
|
|
|
|
}
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2012-03-19 02:29:16 +00:00
|
|
|
/**
|
|
|
|
* Assertions for rules zero.
|
|
|
|
*
|
2013-07-05 15:19:22 +00:00
|
|
|
* @return void
|
2012-03-19 02:29:16 +00:00
|
|
|
*/
|
|
|
|
public function assertRulesZero() {
|
2013-07-22 19:08:05 +00:00
|
|
|
$singular = $this->_singular();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Plural Rule 0 (translated)', $singular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$plurals = $this->_plural();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('1 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('2 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('3 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('4 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('5 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('6 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('7 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('8 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('9 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('10 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('11 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('12 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('13 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('14 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('15 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('16 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('17 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('18 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('19 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('20 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('21 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('22 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('23 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('24 ends with any # (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('25 ends with any # (translated)', $plurals));
|
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$coreSingular = $this->_singularFromCore();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Plural Rule 0 (from core translated)', $coreSingular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$corePlurals = $this->_pluralFromCore();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('1 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('2 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('3 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('4 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('5 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('6 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('7 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('8 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('9 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('10 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('11 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('12 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('13 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('14 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('15 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('16 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('17 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('18 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('19 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('20 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('21 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('22 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('23 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('24 ends with any # (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('25 ends with any # (from core translated)', $corePlurals));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testPoRulesOne method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testPoRulesOne() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_1_po');
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertRulesOne();
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testMoRulesOne method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testMoRulesOne() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_1_mo');
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertRulesOne();
|
|
|
|
}
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2012-03-19 02:29:16 +00:00
|
|
|
/**
|
|
|
|
* Assertions for plural rule one
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function assertRulesOne() {
|
2013-07-22 19:08:05 +00:00
|
|
|
$singular = $this->_singular();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Plural Rule 1 (translated)', $singular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$plurals = $this->_plural();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('1 = 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('2 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('3 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('4 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('5 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('6 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('7 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('8 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('9 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('10 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('11 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('12 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('13 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('14 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('15 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('16 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('17 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('18 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('19 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('20 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('21 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('22 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('23 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('24 = 0 or > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('25 = 0 or > 1 (translated)', $plurals));
|
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$coreSingular = $this->_singularFromCore();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Plural Rule 1 (from core translated)', $coreSingular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$corePlurals = $this->_pluralFromCore();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('1 = 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('2 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('3 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('4 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('5 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('6 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('7 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('8 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('9 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('10 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('11 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('12 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('13 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('14 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('15 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('16 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('17 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('18 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('19 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('20 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('21 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('22 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('23 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('24 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('25 = 0 or > 1 (from core translated)', $corePlurals));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2012-03-19 02:29:16 +00:00
|
|
|
/**
|
|
|
|
* testMoRulesTwo method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testMoRulesTwo() {
|
|
|
|
Configure::write('Config.language', 'rule_2_mo');
|
|
|
|
$this->assertRulesTwo();
|
|
|
|
}
|
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testPoRulesTwo method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testPoRulesTwo() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_2_po');
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertRulesTwo();
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
2012-03-19 02:29:16 +00:00
|
|
|
* Assertions for rules Two
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2012-03-19 02:29:16 +00:00
|
|
|
public function assertRulesTwo() {
|
2013-07-22 19:08:05 +00:00
|
|
|
$singular = $this->_singular();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Plural Rule 2 (translated)', $singular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$plurals = $this->_plural();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 = 0 or 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('1 = 0 or 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('2 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('3 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('4 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('5 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('6 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('7 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('8 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('9 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('10 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('11 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('12 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('13 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('14 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('15 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('16 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('17 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('18 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('19 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('20 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('21 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('22 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('23 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('24 > 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('25 > 1 (translated)', $plurals));
|
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$coreSingular = $this->_singularFromCore();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Plural Rule 2 (from core translated)', $coreSingular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$corePlurals = $this->_pluralFromCore();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 = 0 or 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('1 = 0 or 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('2 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('3 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('4 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('5 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('6 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('7 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('8 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('9 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('10 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('11 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('12 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('13 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('14 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('15 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('16 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('17 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('18 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('19 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('20 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('21 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('22 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('23 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('24 > 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('25 > 1 (from core translated)', $corePlurals));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testPoRulesThree method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testPoRulesThree() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_3_po');
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertRulesThree();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* testMoRulesThree method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testMoRulesThree() {
|
|
|
|
Configure::write('Config.language', 'rule_3_mo');
|
|
|
|
$this->assertRulesThree();
|
|
|
|
}
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2012-03-19 02:29:16 +00:00
|
|
|
/**
|
|
|
|
* Assert rules for plural three.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function assertRulesThree() {
|
2013-07-22 19:08:05 +00:00
|
|
|
$singular = $this->_singular();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Plural Rule 3 (translated)', $singular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$plurals = $this->_plural();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 = 0 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('1 ends 1 but not 11 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('2 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('3 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('4 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('5 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('6 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('7 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('8 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('9 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('10 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('11 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('12 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('13 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('14 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('15 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('16 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('17 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('18 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('19 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('20 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('21 ends 1 but not 11 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('22 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('23 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('24 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$coreSingular = $this->_singularFromCore();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Plural Rule 3 (from core translated)', $coreSingular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$corePlurals = $this->_pluralFromCore();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 = 0 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('1 ends 1 but not 11 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('2 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('3 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('4 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('10 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('21 ends 1 but not 11 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
2012-03-19 02:29:16 +00:00
|
|
|
* testPoRulesFour method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2012-03-19 02:29:16 +00:00
|
|
|
public function testPoRulesFour() {
|
|
|
|
Configure::write('Config.language', 'rule_4_po');
|
|
|
|
$this->assertRulesFour();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* testMoRulesFour method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testMoRulesFour() {
|
|
|
|
Configure::write('Config.language', 'rule_4_mo');
|
|
|
|
$this->assertRulesFour();
|
|
|
|
}
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2012-03-19 02:29:16 +00:00
|
|
|
/**
|
|
|
|
* Run the assertions for Rule 4 plurals.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function assertRulesFour() {
|
2013-07-22 19:08:05 +00:00
|
|
|
$singular = $this->_singular();
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertEquals('Plural Rule 4 (translated)', $singular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$plurals = $this->_plural();
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('1 = 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('2 = 2 (translated)', $plurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('3 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('4 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('5 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('6 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('7 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('8 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('9 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('10 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('11 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('12 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('13 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('14 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('15 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('16 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('17 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('18 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('19 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('20 everything else (translated)', $plurals));
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertTrue(in_array('21 everything else (translated)', $plurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('22 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('23 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('24 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$coreSingular = $this->_singularFromCore();
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertEquals('Plural Rule 4 (from core translated)', $coreSingular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$corePlurals = $this->_pluralFromCore();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('1 = 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('2 = 2 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('3 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('4 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('10 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testPoRulesFive method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testPoRulesFive() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_5_po');
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertRulesFive();
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testMoRulesFive method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testMoRulesFive() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_5_mo');
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertRulesFive();
|
|
|
|
}
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2012-03-19 02:29:16 +00:00
|
|
|
/**
|
|
|
|
* Run the assertions for rule 5 plurals
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function assertRulesFive() {
|
2013-07-22 19:08:05 +00:00
|
|
|
$singular = $this->_singular();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Plural Rule 5 (translated)', $singular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$plurals = $this->_plural();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 = 0 or ends in 01-19 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('0 = 0 or ends in 01-19 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('1 = 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('2 = 0 or ends in 01-19 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('3 = 0 or ends in 01-19 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('4 = 0 or ends in 01-19 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('5 = 0 or ends in 01-19 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('6 = 0 or ends in 01-19 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('7 = 0 or ends in 01-19 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('8 = 0 or ends in 01-19 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('9 = 0 or ends in 01-19 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('10 = 0 or ends in 01-19 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('11 = 0 or ends in 01-19 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('12 = 0 or ends in 01-19 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('13 = 0 or ends in 01-19 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('14 = 0 or ends in 01-19 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('15 = 0 or ends in 01-19 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('16 = 0 or ends in 01-19 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('17 = 0 or ends in 01-19 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('18 = 0 or ends in 01-19 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('19 = 0 or ends in 01-19 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('20 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('21 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('22 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('23 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('24 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$coreSingular = $this->_singularFromCore();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Plural Rule 5 (from core translated)', $coreSingular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$corePlurals = $this->_pluralFromCore();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('0 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('1 = 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('2 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('3 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('4 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('5 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('6 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('7 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('8 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('9 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('10 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('11 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('12 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('13 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('14 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('15 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('16 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('17 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('18 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('19 = 0 or ends in 01-19 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testPoRulesSix method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testPoRulesSix() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_6_po');
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertRulesSix();
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testMoRulesSix method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2012-03-19 02:29:16 +00:00
|
|
|
public function testMoRulesSix() {
|
|
|
|
Configure::write('Config.language', 'rule_6_mo');
|
|
|
|
$this->assertRulesSix();
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
2012-03-19 02:29:16 +00:00
|
|
|
* Assertions for the sixth plural rules.
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2012-03-19 02:29:16 +00:00
|
|
|
public function assertRulesSix() {
|
2013-07-22 19:08:05 +00:00
|
|
|
$singular = $this->_singular();
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertEquals('Plural Rule 6 (translated)', $singular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$plurals = $this->_plural();
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertTrue(in_array('0 ends in 0 or ends in 10-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('1 ends in 1, not 11 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('2 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('3 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('4 everything else (translated)', $plurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('5 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('6 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('7 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('8 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('9 everything else (translated)', $plurals));
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertTrue(in_array('10 ends in 0 or ends in 10-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('11 ends in 0 or ends in 10-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('12 ends in 0 or ends in 10-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('13 ends in 0 or ends in 10-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('14 ends in 0 or ends in 10-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('15 ends in 0 or ends in 10-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('16 ends in 0 or ends in 10-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('17 ends in 0 or ends in 10-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('18 ends in 0 or ends in 10-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('19 ends in 0 or ends in 10-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('20 ends in 0 or ends in 10-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('21 ends in 1, not 11 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('22 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('23 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('24 everything else (translated)', $plurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$coreSingular = $this->_singularFromCore();
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertEquals('Plural Rule 6 (from core translated)', $coreSingular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$corePlurals = $this->_pluralFromCore();
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertTrue(in_array('0 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('1 ends in 1, not 11 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('2 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('3 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('4 everything else (from core translated)', $corePlurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals));
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertTrue(in_array('10 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('11 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('12 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('13 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('14 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('15 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('16 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('17 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('18 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('19 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('20 ends in 0 or ends in 10-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('21 ends in 1, not 11 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
2012-03-19 02:29:16 +00:00
|
|
|
* testPoRulesSeven method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2012-03-19 02:29:16 +00:00
|
|
|
public function testPoRulesSeven() {
|
|
|
|
Configure::write('Config.language', 'rule_7_po');
|
|
|
|
$this->assertRulesSeven();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* testMoRulesSeven method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testMoRulesSeven() {
|
|
|
|
Configure::write('Config.language', 'rule_7_mo');
|
|
|
|
$this->assertRulesSeven();
|
|
|
|
}
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2012-03-19 02:29:16 +00:00
|
|
|
/**
|
|
|
|
* Run assertions for seventh plural rules
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function assertRulesSeven() {
|
2013-07-22 19:08:05 +00:00
|
|
|
$singular = $this->_singular();
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertEquals('Plural Rule 7 (translated)', $singular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$plurals = $this->_plural();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertTrue(in_array('1 ends in 1, not 11 (translated)', $plurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('2 ends in 2-4, not 12-14 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('3 ends in 2-4, not 12-14 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('4 ends in 2-4, not 12-14 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('5 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('6 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('7 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('8 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('9 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('10 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('11 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('12 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('13 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('14 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('15 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('16 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('17 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('18 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('19 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('20 everything else (translated)', $plurals));
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertTrue(in_array('21 ends in 1, not 11 (translated)', $plurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('22 ends in 2-4, not 12-14 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('23 ends in 2-4, not 12-14 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('24 ends in 2-4, not 12-14 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$coreSingular = $this->_singularFromCore();
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertEquals('Plural Rule 7 (from core translated)', $coreSingular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$corePlurals = $this->_pluralFromCore();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertTrue(in_array('1 ends in 1, not 11 (from core translated)', $corePlurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('2 ends in 2-4, not 12-14 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('3 ends in 2-4, not 12-14 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('4 ends in 2-4, not 12-14 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('10 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals));
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertTrue(in_array('21 ends in 1, not 11 (from core translated)', $corePlurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('22 ends in 2-4, not 12-14 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('23 ends in 2-4, not 12-14 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('24 ends in 2-4, not 12-14 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
2012-03-19 02:29:16 +00:00
|
|
|
* testPoRulesEight method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2012-03-19 02:29:16 +00:00
|
|
|
public function testPoRulesEight() {
|
|
|
|
Configure::write('Config.language', 'rule_8_po');
|
|
|
|
$this->assertRulesEight();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* testMoRulesEight method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testMoRulesEight() {
|
|
|
|
Configure::write('Config.language', 'rule_8_mo');
|
|
|
|
$this->assertRulesEight();
|
|
|
|
}
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2012-03-19 02:29:16 +00:00
|
|
|
/**
|
|
|
|
* Run assertions for the eighth plural rule.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function assertRulesEight() {
|
2013-07-22 19:08:05 +00:00
|
|
|
$singular = $this->_singular();
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertEquals('Plural Rule 8 (translated)', $singular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$plurals = $this->_plural();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertTrue(in_array('1 is 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('2 is 2-4 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('3 is 2-4 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('4 is 2-4 (translated)', $plurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('5 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('6 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('7 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('8 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('9 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('10 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('11 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('12 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('13 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('14 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('15 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('16 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('17 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('18 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('19 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('20 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('21 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('22 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('23 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('24 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$coreSingular = $this->_singularFromCore();
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertEquals('Plural Rule 8 (from core translated)', $coreSingular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$corePlurals = $this->_pluralFromCore();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertTrue(in_array('1 is 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('2 is 2-4 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('3 is 2-4 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('4 is 2-4 (from core translated)', $corePlurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('10 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
2012-03-19 02:29:16 +00:00
|
|
|
* testPoRulesNine method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2012-03-19 02:29:16 +00:00
|
|
|
public function testPoRulesNine() {
|
|
|
|
Configure::write('Config.language', 'rule_9_po');
|
|
|
|
$this->assertRulesNine();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* testMoRulesNine method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testMoRulesNine() {
|
|
|
|
Configure::write('Config.language', 'rule_9_mo');
|
|
|
|
$this->assertRulesNine();
|
|
|
|
}
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2012-03-19 02:29:16 +00:00
|
|
|
/**
|
|
|
|
* Assert plural rules nine
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function assertRulesNine() {
|
2013-07-22 19:08:05 +00:00
|
|
|
$singular = $this->_singular();
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertEquals('Plural Rule 9 (translated)', $singular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$plurals = $this->_plural();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertTrue(in_array('1 is 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('2 ends in 2-4, not 12-14 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('3 ends in 2-4, not 12-14 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('4 ends in 2-4, not 12-14 (translated)', $plurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('5 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('6 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('7 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('8 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('9 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('10 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('11 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('12 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('13 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('14 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('15 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('16 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('17 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('18 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('19 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('20 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('21 everything else (translated)', $plurals));
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertTrue(in_array('22 ends in 2-4, not 12-14 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('23 ends in 2-4, not 12-14 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('24 ends in 2-4, not 12-14 (translated)', $plurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$coreSingular = $this->_singularFromCore();
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertEquals('Plural Rule 9 (from core translated)', $coreSingular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$corePlurals = $this->_pluralFromCore();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('1 is 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('2 ends in 2-4, not 12-14 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('3 ends in 2-4, not 12-14 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('4 ends in 2-4, not 12-14 (from core translated)', $corePlurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('10 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals));
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertTrue(in_array('22 ends in 2-4, not 12-14 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('23 ends in 2-4, not 12-14 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('24 ends in 2-4, not 12-14 (from core translated)', $corePlurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
2012-03-19 02:29:16 +00:00
|
|
|
* testPoRulesTen method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2012-03-19 02:29:16 +00:00
|
|
|
public function testPoRulesTen() {
|
|
|
|
Configure::write('Config.language', 'rule_10_po');
|
|
|
|
$this->assertRulesTen();
|
|
|
|
}
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2012-03-19 02:29:16 +00:00
|
|
|
/**
|
|
|
|
* testMoRulesTen method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testMoRulesTen() {
|
|
|
|
Configure::write('Config.language', 'rule_10_mo');
|
|
|
|
$this->assertRulesTen();
|
|
|
|
}
|
2008-10-10 00:39:01 +00:00
|
|
|
|
2012-03-19 02:29:16 +00:00
|
|
|
/**
|
|
|
|
* Assertions for plural rules 10
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function assertRulesTen() {
|
2013-07-22 19:08:05 +00:00
|
|
|
$singular = $this->_singular();
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertEquals('Plural Rule 10 (translated)', $singular);
|
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$plurals = $this->_plural();
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('1 ends in 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('2 ends in 2 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('3 ends in 03-04 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('4 ends in 03-04 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('5 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('6 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('7 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('8 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('9 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('10 everything else (translated)', $plurals));
|
2008-10-10 00:39:01 +00:00
|
|
|
$this->assertTrue(in_array('11 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('12 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('13 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('14 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('15 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('16 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('17 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('18 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('19 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('20 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('21 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('22 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('23 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('24 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$coreSingular = $this->_singularFromCore();
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertEquals('Plural Rule 10 (from core translated)', $coreSingular);
|
2008-10-10 00:39:01 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$corePlurals = $this->_pluralFromCore();
|
2008-10-10 00:39:01 +00:00
|
|
|
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('1 ends in 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('2 ends in 2 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('3 ends in 03-04 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('4 ends in 03-04 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('10 everything else (from core translated)', $corePlurals));
|
2008-10-10 00:39:01 +00:00
|
|
|
$this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2012-03-19 02:29:16 +00:00
|
|
|
/**
|
|
|
|
* testPoRulesEleven method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testPoRulesEleven() {
|
|
|
|
Configure::write('Config.language', 'rule_11_po');
|
|
|
|
$this->assertRulesEleven();
|
|
|
|
}
|
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testMoRulesEleven method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testMoRulesEleven() {
|
2008-10-10 00:39:01 +00:00
|
|
|
Configure::write('Config.language', 'rule_11_mo');
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertRulesEleven();
|
|
|
|
}
|
2008-10-10 00:39:01 +00:00
|
|
|
|
2012-03-19 02:29:16 +00:00
|
|
|
/**
|
|
|
|
* Assertions for plural rules eleven
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function assertRulesEleven() {
|
2013-07-22 19:08:05 +00:00
|
|
|
$singular = $this->_singular();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Plural Rule 11 (translated)', $singular);
|
2008-10-10 00:39:01 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$plurals = $this->_plural();
|
2008-10-10 00:39:01 +00:00
|
|
|
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('1 is 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('2 is 2 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('3 is 3-6 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('4 is 3-6 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('5 is 3-6 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('6 is 3-6 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('7 is 7-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('8 is 7-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('9 is 7-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('10 is 7-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('11 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('12 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('13 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('14 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('15 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('16 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('17 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('18 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('19 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('20 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('21 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('22 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('23 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('24 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$coreSingular = $this->_singularFromCore();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Plural Rule 11 (from core translated)', $coreSingular);
|
2008-10-10 00:39:01 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$corePlurals = $this->_pluralFromCore();
|
2008-10-10 00:39:01 +00:00
|
|
|
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('1 is 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('2 is 2 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('3 is 3-6 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('4 is 3-6 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('5 is 3-6 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('6 is 3-6 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('7 is 7-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('8 is 7-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('9 is 7-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('10 is 7-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testPoRulesTwelve method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testPoRulesTwelve() {
|
2008-10-10 00:39:01 +00:00
|
|
|
Configure::write('Config.language', 'rule_12_po');
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertRulesTwelve();
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-02 19:22:55 +00:00
|
|
|
/**
|
|
|
|
* testMoRulesTwelve method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testMoRulesTwelve() {
|
2008-10-10 00:39:01 +00:00
|
|
|
Configure::write('Config.language', 'rule_12_mo');
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertRulesTwelve();
|
|
|
|
}
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2012-03-19 02:29:16 +00:00
|
|
|
/**
|
|
|
|
* Assertions for plural rules twelve
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function assertRulesTwelve() {
|
2013-07-22 19:08:05 +00:00
|
|
|
$singular = $this->_singular();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Plural Rule 12 (translated)', $singular);
|
2008-10-10 00:39:01 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$plurals = $this->_plural();
|
2008-10-10 00:39:01 +00:00
|
|
|
$this->assertTrue(in_array('0 is 0 or 3-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('1 is 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('2 is 2 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('3 is 0 or 3-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('4 is 0 or 3-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('5 is 0 or 3-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('6 is 0 or 3-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('7 is 0 or 3-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('8 is 0 or 3-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('9 is 0 or 3-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('10 is 0 or 3-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('11 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('12 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('13 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('14 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('15 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('16 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('17 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('18 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('19 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('20 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('21 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('22 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('23 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('24 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$coreSingular = $this->_singularFromCore();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Plural Rule 12 (from core translated)', $coreSingular);
|
2008-10-10 00:39:01 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$corePlurals = $this->_pluralFromCore();
|
2008-10-10 00:39:01 +00:00
|
|
|
$this->assertTrue(in_array('0 is 0 or 3-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('1 is 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('2 is 2 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('3 is 0 or 3-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('4 is 0 or 3-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('5 is 0 or 3-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('6 is 0 or 3-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('7 is 0 or 3-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('8 is 0 or 3-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('9 is 0 or 3-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('10 is 0 or 3-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('11 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('12 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2012-03-19 02:29:16 +00:00
|
|
|
/**
|
|
|
|
* testMoRulesThirteen method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testmoRulesThirteen() {
|
|
|
|
Configure::write('Config.language', 'rule_13_mo');
|
|
|
|
$this->assertRulesThirteen();
|
|
|
|
}
|
2012-03-19 03:25:19 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* testPoRulesThirteen method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testPoRulesThirteen() {
|
2008-10-10 00:39:01 +00:00
|
|
|
Configure::write('Config.language', 'rule_13_po');
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertRulesThirteen();
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
2012-03-19 02:29:16 +00:00
|
|
|
* Assertions for plural rules thirteen
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2012-03-19 02:29:16 +00:00
|
|
|
public function assertRulesThirteen() {
|
2013-07-22 19:08:05 +00:00
|
|
|
$singular = $this->_singular();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Plural Rule 13 (translated)', $singular);
|
2008-10-10 00:39:01 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$plurals = $this->_plural();
|
2008-10-10 00:39:01 +00:00
|
|
|
$this->assertTrue(in_array('0 is 0 or ends in 01-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('1 is 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('2 is 0 or ends in 01-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('3 is 0 or ends in 01-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('4 is 0 or ends in 01-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('5 is 0 or ends in 01-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('6 is 0 or ends in 01-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('7 is 0 or ends in 01-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('8 is 0 or ends in 01-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('9 is 0 or ends in 01-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('10 is 0 or ends in 01-10 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('11 ends in 11-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('12 ends in 11-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('13 ends in 11-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('14 ends in 11-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('15 ends in 11-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('16 ends in 11-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('17 ends in 11-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('18 ends in 11-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('19 ends in 11-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('20 ends in 11-20 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('21 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('22 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('23 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('24 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$coreSingular = $this->_singularFromCore();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Plural Rule 13 (from core translated)', $coreSingular);
|
2008-10-10 00:39:01 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$corePlurals = $this->_pluralFromCore();
|
2008-10-10 00:39:01 +00:00
|
|
|
$this->assertTrue(in_array('0 is 0 or ends in 01-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('1 is 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('2 is 0 or ends in 01-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('3 is 0 or ends in 01-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('4 is 0 or ends in 01-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('5 is 0 or ends in 01-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('6 is 0 or ends in 01-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('7 is 0 or ends in 01-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('8 is 0 or ends in 01-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('9 is 0 or ends in 01-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('10 is 0 or ends in 01-10 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('11 ends in 11-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('12 ends in 11-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('13 ends in 11-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('14 ends in 11-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('15 ends in 11-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('16 ends in 11-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('17 ends in 11-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('18 ends in 11-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('19 ends in 11-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('20 ends in 11-20 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('21 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('22 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2012-03-19 02:29:16 +00:00
|
|
|
/**
|
|
|
|
* testMoRulesFourteen method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testMoRulesFourteen() {
|
|
|
|
Configure::write('Config.language', 'rule_14_mo');
|
|
|
|
$this->assertRulesFourteen();
|
|
|
|
}
|
2012-03-19 03:25:19 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* testPoRulesFourteen method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testPoRulesFourteen() {
|
2008-10-10 00:39:01 +00:00
|
|
|
Configure::write('Config.language', 'rule_14_po');
|
2012-03-19 02:29:16 +00:00
|
|
|
$this->assertRulesFourteen();
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
2012-03-19 02:29:16 +00:00
|
|
|
* Assertions for plural rules fourteen
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2012-03-19 02:29:16 +00:00
|
|
|
public function assertRulesFourteen() {
|
2013-07-22 19:08:05 +00:00
|
|
|
$singular = $this->_singular();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Plural Rule 14 (translated)', $singular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$plurals = $this->_plural();
|
2008-10-10 00:39:01 +00:00
|
|
|
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('1 ends in 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('2 ends in 2 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('3 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('4 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('5 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('6 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('7 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('8 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('9 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('10 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('11 ends in 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('12 ends in 2 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('13 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('14 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('15 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('16 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('17 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('18 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('19 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('20 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('21 ends in 1 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('22 ends in 2 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('23 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('24 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$coreSingular = $this->_singularFromCore();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Plural Rule 14 (from core translated)', $coreSingular);
|
2008-10-10 00:39:01 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$corePlurals = $this->_pluralFromCore();
|
2008-10-10 00:39:01 +00:00
|
|
|
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('1 ends in 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('2 ends in 2 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('3 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('4 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('5 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('6 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('7 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('8 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('9 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('10 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('11 ends in 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('12 ends in 2 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('13 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('14 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('15 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('16 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('17 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('18 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('19 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('20 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('21 ends in 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('22 ends in 2 (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('23 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('24 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('25 everything else (from core translated)', $corePlurals));
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* testSetLanguageWithSession method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2012-02-23 13:38:02 +00:00
|
|
|
public function testSetLanguageWithSession() {
|
2014-01-20 07:56:35 +00:00
|
|
|
CakeSession::write('Config.language', 'po');
|
2013-07-22 19:08:05 +00:00
|
|
|
$singular = $this->_singular();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Po (translated)', $singular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$plurals = $this->_plural();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 everything else (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('1 is 1 (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('2 is 2-4 (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('3 is 2-4 (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('4 is 2-4 (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('5 everything else (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('6 everything else (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('7 everything else (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('8 everything else (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('9 everything else (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('10 everything else (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('11 everything else (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('12 everything else (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('13 everything else (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('14 everything else (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('15 everything else (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('16 everything else (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('17 everything else (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('18 everything else (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('19 everything else (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('20 everything else (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('21 everything else (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('22 everything else (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('23 everything else (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('24 everything else (po translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('25 everything else (po translated)', $plurals));
|
2014-01-20 07:56:35 +00:00
|
|
|
CakeSession::delete('Config.language');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* testNoCoreTranslation method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2012-02-23 13:38:02 +00:00
|
|
|
public function testNoCoreTranslation() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'po');
|
2013-07-22 19:08:05 +00:00
|
|
|
$singular = $this->_singular();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Po (translated)', $singular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$coreSingular = $this->_singularFromCore();
|
2011-11-16 00:07:56 +00:00
|
|
|
$this->assertNotEquals('Po (from core translated)', $coreSingular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$corePlurals = $this->_pluralFromCore();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertFalse(in_array('0 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('1 is 1 (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('2 is 2-4 (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('3 is 2-4 (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('4 is 2-4 (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('5 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('6 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('7 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('8 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('9 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('10 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('11 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('12 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('13 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('14 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('15 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('16 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('17 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('18 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('19 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('20 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('21 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('22 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('23 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('24 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertFalse(in_array('25 everything else (from core translated)', $corePlurals));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-03-18 17:55:58 +00:00
|
|
|
/**
|
|
|
|
* testPluginTranslation method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testPluginTranslation() {
|
2009-06-11 16:13:16 +00:00
|
|
|
App::build(array(
|
2012-02-18 12:31:29 +00:00
|
|
|
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
2009-06-11 16:13:16 +00:00
|
|
|
));
|
Closes #1855, Separate translation files per plugin. This is now supported using !__d() and !__dn().
Example singular usage: !__d('plugin_name', $string, true); returns translated singular string from pluginsPath/plugin_name/locale/"language"/LC_MESSAGE/plugin_name.(po/mo).
Example plural usage: sprintf(!__dn('plugin_name', '%d = 1', '%d = 0 or > 1', $number, true), $number ); returns translated plural strings from pluginsPath/plugin_name/locale/"language"/LC_MESSAGE/plugin_name.(po/mo).
Closes #5007, Support for multiple additional locale paths. Configure::write('localePaths', $paths); accepts an array of $paths. $localePaths = array(); can also be used in bootstrap.php
Added Configure::$shellPaths; additional paths can be set in bootstrap.php $shellPaths = array();
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7754 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-10-16 05:16:00 +00:00
|
|
|
|
|
|
|
Configure::write('Config.language', 'po');
|
2013-07-22 19:08:05 +00:00
|
|
|
$singular = $this->_domainSingular();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Plural Rule 1 (from plugin)', $singular);
|
Closes #1855, Separate translation files per plugin. This is now supported using !__d() and !__dn().
Example singular usage: !__d('plugin_name', $string, true); returns translated singular string from pluginsPath/plugin_name/locale/"language"/LC_MESSAGE/plugin_name.(po/mo).
Example plural usage: sprintf(!__dn('plugin_name', '%d = 1', '%d = 0 or > 1', $number, true), $number ); returns translated plural strings from pluginsPath/plugin_name/locale/"language"/LC_MESSAGE/plugin_name.(po/mo).
Closes #5007, Support for multiple additional locale paths. Configure::write('localePaths', $paths); accepts an array of $paths. $localePaths = array(); can also be used in bootstrap.php
Added Configure::$shellPaths; additional paths can be set in bootstrap.php $shellPaths = array();
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7754 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-10-16 05:16:00 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$plurals = $this->_domainPlural();
|
Closes #1855, Separate translation files per plugin. This is now supported using !__d() and !__dn().
Example singular usage: !__d('plugin_name', $string, true); returns translated singular string from pluginsPath/plugin_name/locale/"language"/LC_MESSAGE/plugin_name.(po/mo).
Example plural usage: sprintf(!__dn('plugin_name', '%d = 1', '%d = 0 or > 1', $number, true), $number ); returns translated plural strings from pluginsPath/plugin_name/locale/"language"/LC_MESSAGE/plugin_name.(po/mo).
Closes #5007, Support for multiple additional locale paths. Configure::write('localePaths', $paths); accepts an array of $paths. $localePaths = array(); can also be used in bootstrap.php
Added Configure::$shellPaths; additional paths can be set in bootstrap.php $shellPaths = array();
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7754 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-10-16 05:16:00 +00:00
|
|
|
$this->assertTrue(in_array('0 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('1 = 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('2 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('3 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('4 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('5 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('6 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('7 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('8 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('9 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('10 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('11 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('12 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('13 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('14 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('15 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('16 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('17 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('18 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('19 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('20 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('21 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('22 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('23 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('24 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('25 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* testPoMultipleLineTranslation method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2012-02-23 13:38:02 +00:00
|
|
|
public function testPoMultipleLineTranslation() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'po');
|
2008-11-06 22:57:50 +00:00
|
|
|
|
|
|
|
$string = "This is a multiline translation\n";
|
|
|
|
$string .= "broken up over multiple lines.\n";
|
|
|
|
$string .= "This is the third line.\n";
|
|
|
|
$string .= "This is the forth line.";
|
2010-04-15 16:38:12 +00:00
|
|
|
$result = __($string);
|
2008-11-06 22:57:50 +00:00
|
|
|
|
|
|
|
$expected = "This is a multiline translation\n";
|
|
|
|
$expected .= "broken up over multiple lines.\n";
|
|
|
|
$expected .= "This is the third line.\n";
|
|
|
|
$expected .= "This is the forth line. (translated)";
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals($expected, $result);
|
2008-11-06 22:57:50 +00:00
|
|
|
|
|
|
|
// Windows Newline is \r\n
|
|
|
|
$string = "This is a multiline translation\r\n";
|
|
|
|
$string .= "broken up over multiple lines.\r\n";
|
|
|
|
$string .= "This is the third line.\r\n";
|
|
|
|
$string .= "This is the forth line.";
|
2010-04-15 16:38:12 +00:00
|
|
|
$result = __($string);
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals($expected, $result);
|
2008-10-28 01:51:18 +00:00
|
|
|
|
2008-11-06 22:57:50 +00:00
|
|
|
$singular = "valid\nsecond line";
|
|
|
|
$plural = "valids\nsecond line";
|
|
|
|
|
2010-04-15 16:38:12 +00:00
|
|
|
$result = __n($singular, $plural, 1);
|
2008-11-06 22:57:50 +00:00
|
|
|
$expected = "v\nsecond line";
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals($expected, $result);
|
2008-11-06 22:57:50 +00:00
|
|
|
|
2010-04-15 16:38:12 +00:00
|
|
|
$result = __n($singular, $plural, 2);
|
2008-11-06 22:57:50 +00:00
|
|
|
$expected = "vs\nsecond line";
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals($expected, $result);
|
2008-11-06 22:57:50 +00:00
|
|
|
|
|
|
|
$string = "This is a multiline translation\n";
|
|
|
|
$string .= "broken up over multiple lines.\n";
|
|
|
|
$string .= "This is the third line.\n";
|
|
|
|
$string .= "This is the forth line.";
|
|
|
|
|
|
|
|
$singular = "%d = 1\n" . $string;
|
|
|
|
$plural = "%d = 0 or > 1\n" . $string;
|
|
|
|
|
2010-04-15 16:38:12 +00:00
|
|
|
$result = __n($singular, $plural, 1);
|
2008-11-06 22:57:50 +00:00
|
|
|
$expected = "%d is 1\n" . $string;
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals($expected, $result);
|
2008-11-06 22:57:50 +00:00
|
|
|
|
2010-04-15 16:38:12 +00:00
|
|
|
$result = __n($singular, $plural, 2);
|
2008-11-06 22:57:50 +00:00
|
|
|
$expected = "%d is 2-4\n" . $string;
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals($expected, $result);
|
2008-11-06 22:57:50 +00:00
|
|
|
|
|
|
|
// Windows Newline is \r\n
|
|
|
|
$string = "This is a multiline translation\r\n";
|
|
|
|
$string .= "broken up over multiple lines.\r\n";
|
|
|
|
$string .= "This is the third line.\r\n";
|
|
|
|
$string .= "This is the forth line.";
|
|
|
|
|
|
|
|
$singular = "%d = 1\r\n" . $string;
|
|
|
|
$plural = "%d = 0 or > 1\r\n" . $string;
|
2008-10-28 01:51:18 +00:00
|
|
|
|
2010-04-15 16:38:12 +00:00
|
|
|
$result = __n($singular, $plural, 1);
|
2008-11-06 22:57:50 +00:00
|
|
|
$expected = "%d is 1\n" . str_replace("\r\n", "\n", $string);
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals($expected, $result);
|
2008-10-28 01:51:18 +00:00
|
|
|
|
2010-04-15 16:38:12 +00:00
|
|
|
$result = __n($singular, $plural, 2);
|
2008-11-06 22:57:50 +00:00
|
|
|
$expected = "%d is 2-4\n" . str_replace("\r\n", "\n", $string);
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals($expected, $result);
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* testPoNoTranslationNeeded method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2012-02-23 13:38:02 +00:00
|
|
|
public function testPoNoTranslationNeeded() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'po');
|
2010-04-15 16:38:12 +00:00
|
|
|
$result = __('No Translation needed');
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('No Translation needed', $result);
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-23 00:27:33 +00:00
|
|
|
/**
|
|
|
|
* testPoQuotedString method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2012-02-23 13:38:02 +00:00
|
|
|
public function testPoQuotedString() {
|
2012-02-06 10:36:38 +00:00
|
|
|
Configure::write('Config.language', 'po');
|
2008-06-23 00:27:33 +00:00
|
|
|
$expected = 'this is a "quoted string" (translated)';
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals($expected, __('this is a "quoted string"'));
|
2008-06-23 00:27:33 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-07-03 15:54:26 +00:00
|
|
|
/**
|
|
|
|
* testFloatValue method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testFloatValue() {
|
2009-02-18 01:23:42 +00:00
|
|
|
Configure::write('Config.language', 'rule_9_po');
|
2009-02-18 01:01:39 +00:00
|
|
|
|
2010-04-15 16:38:12 +00:00
|
|
|
$result = __n('%d = 1', '%d = 0 or > 1', (float)1);
|
2009-02-18 01:23:42 +00:00
|
|
|
$expected = '%d is 1 (translated)';
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals($expected, $result);
|
2009-02-18 01:01:39 +00:00
|
|
|
|
2010-04-15 16:38:12 +00:00
|
|
|
$result = __n('%d = 1', '%d = 0 or > 1', (float)2);
|
2009-02-18 01:23:42 +00:00
|
|
|
$expected = "%d ends in 2-4, not 12-14 (translated)";
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals($expected, $result);
|
2009-02-18 01:01:39 +00:00
|
|
|
|
2010-04-15 16:38:12 +00:00
|
|
|
$result = __n('%d = 1', '%d = 0 or > 1', (float)5);
|
2009-02-18 01:23:42 +00:00
|
|
|
$expected = "%d everything else (translated)";
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals($expected, $result);
|
2009-02-18 01:01:39 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-07-03 15:54:26 +00:00
|
|
|
/**
|
|
|
|
* testCategory method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testCategory() {
|
2009-07-03 15:54:26 +00:00
|
|
|
Configure::write('Config.language', 'po');
|
2014-03-23 11:47:35 +00:00
|
|
|
// Test with default (I18n constant) category.
|
2013-07-22 19:08:05 +00:00
|
|
|
$category = $this->_category();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Monetary Po (translated)', $category);
|
2014-03-23 11:47:35 +00:00
|
|
|
// Test with category number represenation.
|
|
|
|
$category = $this->_category(3);
|
|
|
|
$this->assertEquals('Monetary Po (translated)', $category);
|
2009-07-03 15:54:26 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-07-03 15:54:26 +00:00
|
|
|
/**
|
|
|
|
* testPluginCategory method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testPluginCategory() {
|
2009-07-03 15:54:26 +00:00
|
|
|
Configure::write('Config.language', 'po');
|
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$singular = $this->_domainCategorySingular();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Monetary Plural Rule 1 (from plugin)', $singular);
|
2009-07-03 15:54:26 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$plurals = $this->_domainCategoryPlural();
|
2009-07-03 15:54:26 +00:00
|
|
|
$this->assertTrue(in_array('Monetary 0 = 0 or > 1 (from plugin)', $plurals));
|
|
|
|
$this->assertTrue(in_array('Monetary 1 = 1 (from plugin)', $plurals));
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-07-03 15:54:26 +00:00
|
|
|
/**
|
|
|
|
* testCategoryThenSingular method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testCategoryThenSingular() {
|
2009-07-03 15:54:26 +00:00
|
|
|
Configure::write('Config.language', 'po');
|
2013-07-22 19:08:05 +00:00
|
|
|
$category = $this->_category();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Monetary Po (translated)', $category);
|
2009-07-03 15:54:26 +00:00
|
|
|
|
2013-07-22 19:08:05 +00:00
|
|
|
$singular = $this->_singular();
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals('Po (translated)', $singular);
|
2009-07-03 15:54:26 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2012-01-09 19:49:26 +00:00
|
|
|
/**
|
|
|
|
* testTimeDefinition method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testTimeDefinition() {
|
2009-11-17 18:47:23 +00:00
|
|
|
Configure::write('Config.language', 'po');
|
2010-04-15 16:38:12 +00:00
|
|
|
$result = __c('d_fmt', 5);
|
2010-01-11 19:49:57 +00:00
|
|
|
$expected = '%m/%d/%Y';
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals($expected, $result);
|
2010-01-14 14:24:45 +00:00
|
|
|
|
2010-04-15 16:38:12 +00:00
|
|
|
$result = __c('am_pm', 5);
|
2010-01-14 20:08:48 +00:00
|
|
|
$expected = array('AM', 'PM');
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals($expected, $result);
|
2010-01-14 14:24:45 +00:00
|
|
|
|
2010-04-15 16:38:12 +00:00
|
|
|
$result = __c('abmon', 5);
|
2010-01-14 20:08:48 +00:00
|
|
|
$expected = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals($expected, $result);
|
2009-11-17 00:00:10 +00:00
|
|
|
}
|
|
|
|
|
2012-01-09 19:49:26 +00:00
|
|
|
/**
|
|
|
|
* testTimeDefinitionJapanese method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-11-30 15:44:11 +00:00
|
|
|
public function testTimeDefinitionJapanese() {
|
2010-03-03 02:42:53 +00:00
|
|
|
Configure::write('Config.language', 'ja_jp');
|
2010-04-15 16:38:12 +00:00
|
|
|
$result = __c('d_fmt', 5);
|
2011-04-17 10:35:21 +00:00
|
|
|
|
2010-03-03 02:42:53 +00:00
|
|
|
$expected = "%Y年%m月%d日";
|
2011-04-17 10:35:21 +00:00
|
|
|
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals($expected, $result);
|
2010-03-03 02:42:53 +00:00
|
|
|
|
2010-04-15 16:38:12 +00:00
|
|
|
$result = __c('am_pm', 5);
|
2010-03-03 02:42:53 +00:00
|
|
|
$expected = array("午前", "午後");
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals($expected, $result);
|
2010-03-03 02:42:53 +00:00
|
|
|
|
2010-04-15 16:38:12 +00:00
|
|
|
$result = __c('abmon', 5);
|
2010-03-03 02:42:53 +00:00
|
|
|
$expected = array(" 1月", " 2月", " 3月", " 4月", " 5月", " 6月", " 7月", " 8月", " 9月", "10月", "11月", "12月");
|
2011-11-18 23:42:44 +00:00
|
|
|
$this->assertEquals($expected, $result);
|
2010-03-03 02:42:53 +00:00
|
|
|
}
|
|
|
|
|
2012-01-09 19:49:26 +00:00
|
|
|
/**
|
|
|
|
* testTranslateLanguageParam method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testTranslateLanguageParam() {
|
|
|
|
Configure::write('Config.language', 'rule_0_po');
|
|
|
|
|
2014-03-23 11:47:35 +00:00
|
|
|
$result = I18n::translate('Plural Rule 1', null, null, I18n::LC_MESSAGES);
|
2012-01-09 19:49:26 +00:00
|
|
|
$expected = 'Plural Rule 0 (translated)';
|
|
|
|
$this->assertEquals($expected, $result);
|
|
|
|
|
2014-03-23 11:47:35 +00:00
|
|
|
$result = I18n::translate('Plural Rule 1', null, null, I18n::LC_MESSAGES, null, 'rule_1_po');
|
2012-01-09 19:49:26 +00:00
|
|
|
$expected = 'Plural Rule 1 (translated)';
|
|
|
|
$this->assertEquals($expected, $result);
|
|
|
|
}
|
|
|
|
|
2013-07-28 01:41:22 +00:00
|
|
|
/**
|
|
|
|
* Test that the '' domain causes exceptions.
|
|
|
|
*
|
|
|
|
* @expectedException CakeException
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testTranslateEmptyDomain() {
|
|
|
|
I18n::translate('Plural Rule 1', null, '');
|
|
|
|
}
|
|
|
|
|
2013-04-08 07:51:15 +00:00
|
|
|
/**
|
|
|
|
* testLoadLocaleDefinition method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testLoadLocaleDefinition() {
|
|
|
|
$path = current(App::path('locales'));
|
|
|
|
$result = I18n::loadLocaleDefinition($path . 'nld' . DS . 'LC_TIME');
|
|
|
|
$expected = array('zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag');
|
|
|
|
$this->assertSame($expected, $result['day']);
|
|
|
|
}
|
|
|
|
|
2014-06-08 09:54:28 +00:00
|
|
|
/**
|
|
|
|
* Test basic context support
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testContext() {
|
|
|
|
Configure::write('Config.language', 'nld');
|
|
|
|
|
|
|
|
$this->assertSame("brief", __x('mail', 'letter'));
|
|
|
|
$this->assertSame("letter", __x('character', 'letter'));
|
|
|
|
$this->assertSame("bal", __x('spherical object', 'ball'));
|
|
|
|
$this->assertSame("danspartij", __x('social gathering', 'ball'));
|
|
|
|
$this->assertSame("balans", __('balance'));
|
|
|
|
$this->assertSame("saldo", __x('money', 'balance'));
|
|
|
|
}
|
|
|
|
|
2009-07-03 15:54:26 +00:00
|
|
|
/**
|
|
|
|
* Singular method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2013-07-22 19:08:05 +00:00
|
|
|
protected function _domainCategorySingular($domain = 'test_plugin', $category = 3) {
|
2010-04-15 16:38:12 +00:00
|
|
|
$singular = __dc($domain, 'Plural Rule 1', $category);
|
2009-07-03 15:54:26 +00:00
|
|
|
return $singular;
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-07-03 15:54:26 +00:00
|
|
|
/**
|
|
|
|
* Plural method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2013-07-22 19:08:05 +00:00
|
|
|
protected function _domainCategoryPlural($domain = 'test_plugin', $category = 3) {
|
2009-07-03 15:54:26 +00:00
|
|
|
$plurals = array();
|
|
|
|
for ($number = 0; $number <= 25; $number++) {
|
2012-03-18 22:52:35 +00:00
|
|
|
$plurals[] = sprintf(__dcn($domain, '%d = 1', '%d = 0 or > 1', (float)$number, $category), (float)$number);
|
2009-07-03 15:54:26 +00:00
|
|
|
}
|
|
|
|
return $plurals;
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* Singular method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2013-07-22 19:08:05 +00:00
|
|
|
protected function _domainSingular($domain = 'test_plugin') {
|
2010-04-15 16:38:12 +00:00
|
|
|
$singular = __d($domain, 'Plural Rule 1');
|
Closes #1855, Separate translation files per plugin. This is now supported using !__d() and !__dn().
Example singular usage: !__d('plugin_name', $string, true); returns translated singular string from pluginsPath/plugin_name/locale/"language"/LC_MESSAGE/plugin_name.(po/mo).
Example plural usage: sprintf(!__dn('plugin_name', '%d = 1', '%d = 0 or > 1', $number, true), $number ); returns translated plural strings from pluginsPath/plugin_name/locale/"language"/LC_MESSAGE/plugin_name.(po/mo).
Closes #5007, Support for multiple additional locale paths. Configure::write('localePaths', $paths); accepts an array of $paths. $localePaths = array(); can also be used in bootstrap.php
Added Configure::$shellPaths; additional paths can be set in bootstrap.php $shellPaths = array();
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7754 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-10-16 05:16:00 +00:00
|
|
|
return $singular;
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
Closes #1855, Separate translation files per plugin. This is now supported using !__d() and !__dn().
Example singular usage: !__d('plugin_name', $string, true); returns translated singular string from pluginsPath/plugin_name/locale/"language"/LC_MESSAGE/plugin_name.(po/mo).
Example plural usage: sprintf(!__dn('plugin_name', '%d = 1', '%d = 0 or > 1', $number, true), $number ); returns translated plural strings from pluginsPath/plugin_name/locale/"language"/LC_MESSAGE/plugin_name.(po/mo).
Closes #5007, Support for multiple additional locale paths. Configure::write('localePaths', $paths); accepts an array of $paths. $localePaths = array(); can also be used in bootstrap.php
Added Configure::$shellPaths; additional paths can be set in bootstrap.php $shellPaths = array();
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7754 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-10-16 05:16:00 +00:00
|
|
|
/**
|
|
|
|
* Plural method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2013-07-22 19:08:05 +00:00
|
|
|
protected function _domainPlural($domain = 'test_plugin') {
|
Closes #1855, Separate translation files per plugin. This is now supported using !__d() and !__dn().
Example singular usage: !__d('plugin_name', $string, true); returns translated singular string from pluginsPath/plugin_name/locale/"language"/LC_MESSAGE/plugin_name.(po/mo).
Example plural usage: sprintf(!__dn('plugin_name', '%d = 1', '%d = 0 or > 1', $number, true), $number ); returns translated plural strings from pluginsPath/plugin_name/locale/"language"/LC_MESSAGE/plugin_name.(po/mo).
Closes #5007, Support for multiple additional locale paths. Configure::write('localePaths', $paths); accepts an array of $paths. $localePaths = array(); can also be used in bootstrap.php
Added Configure::$shellPaths; additional paths can be set in bootstrap.php $shellPaths = array();
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7754 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-10-16 05:16:00 +00:00
|
|
|
$plurals = array();
|
|
|
|
for ($number = 0; $number <= 25; $number++) {
|
2012-09-28 11:49:51 +00:00
|
|
|
$plurals[] = sprintf(__dn($domain, '%d = 1', '%d = 0 or > 1', (float)$number), (float)$number);
|
Closes #1855, Separate translation files per plugin. This is now supported using !__d() and !__dn().
Example singular usage: !__d('plugin_name', $string, true); returns translated singular string from pluginsPath/plugin_name/locale/"language"/LC_MESSAGE/plugin_name.(po/mo).
Example plural usage: sprintf(!__dn('plugin_name', '%d = 1', '%d = 0 or > 1', $number, true), $number ); returns translated plural strings from pluginsPath/plugin_name/locale/"language"/LC_MESSAGE/plugin_name.(po/mo).
Closes #5007, Support for multiple additional locale paths. Configure::write('localePaths', $paths); accepts an array of $paths. $localePaths = array(); can also be used in bootstrap.php
Added Configure::$shellPaths; additional paths can be set in bootstrap.php $shellPaths = array();
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7754 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-10-16 05:16:00 +00:00
|
|
|
}
|
|
|
|
return $plurals;
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-07-03 15:54:26 +00:00
|
|
|
/**
|
|
|
|
* category method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2014-03-23 11:47:35 +00:00
|
|
|
protected function _category($category = I18n::LC_MONETARY) {
|
2010-04-15 16:38:12 +00:00
|
|
|
$singular = __c('Plural Rule 1', $category);
|
2009-07-03 15:54:26 +00:00
|
|
|
return $singular;
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
Closes #1855, Separate translation files per plugin. This is now supported using !__d() and !__dn().
Example singular usage: !__d('plugin_name', $string, true); returns translated singular string from pluginsPath/plugin_name/locale/"language"/LC_MESSAGE/plugin_name.(po/mo).
Example plural usage: sprintf(!__dn('plugin_name', '%d = 1', '%d = 0 or > 1', $number, true), $number ); returns translated plural strings from pluginsPath/plugin_name/locale/"language"/LC_MESSAGE/plugin_name.(po/mo).
Closes #5007, Support for multiple additional locale paths. Configure::write('localePaths', $paths); accepts an array of $paths. $localePaths = array(); can also be used in bootstrap.php
Added Configure::$shellPaths; additional paths can be set in bootstrap.php $shellPaths = array();
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7754 3807eeeb-6ff5-0310-8944-8be069107fe0
2008-10-16 05:16:00 +00:00
|
|
|
/**
|
|
|
|
* Singular method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2013-07-22 19:08:05 +00:00
|
|
|
protected function _singular() {
|
2010-04-15 16:38:12 +00:00
|
|
|
$singular = __('Plural Rule 1');
|
2008-05-30 11:40:08 +00:00
|
|
|
return $singular;
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* Plural method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2013-07-22 19:08:05 +00:00
|
|
|
protected function _plural() {
|
2008-05-30 11:40:08 +00:00
|
|
|
$plurals = array();
|
|
|
|
for ($number = 0; $number <= 25; $number++) {
|
2012-03-18 22:52:35 +00:00
|
|
|
$plurals[] = sprintf(__n('%d = 1', '%d = 0 or > 1', (float)$number), (float)$number);
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
return $plurals;
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* singularFromCore method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2013-07-22 19:08:05 +00:00
|
|
|
protected function _singularFromCore() {
|
2010-04-15 16:38:12 +00:00
|
|
|
$singular = __('Plural Rule 1 (from core)');
|
2008-05-30 11:40:08 +00:00
|
|
|
return $singular;
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* pluralFromCore method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2013-07-22 19:08:05 +00:00
|
|
|
protected function _pluralFromCore() {
|
2008-10-10 00:39:01 +00:00
|
|
|
$plurals = array();
|
2008-05-30 11:40:08 +00:00
|
|
|
for ($number = 0; $number <= 25; $number++) {
|
2012-09-28 11:49:51 +00:00
|
|
|
$plurals[] = sprintf(__n('%d = 1 (from core)', '%d = 0 or > 1 (from core)', (float)$number), (float)$number);
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
return $plurals;
|
|
|
|
}
|
|
|
|
}
|