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
|
|
|
*
|
2010-10-03 16:31:21 +00:00
|
|
|
* PHP 5
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2010-05-19 01:15:13 +00:00
|
|
|
* CakePHP(tm) Tests <http://book.cakephp.org/view/1196/Testing>
|
2011-05-29 21:31:39 +00:00
|
|
|
* Copyright 2005-2011, 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
|
|
|
|
* Redistributions of files must retain the above copyright notice
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2011-05-29 21:31:39 +00:00
|
|
|
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2010-05-19 01:15:13 +00:00
|
|
|
* @link http://book.cakephp.org/view/1196/Testing 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
|
2010-10-03 16:27:27 +00:00
|
|
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
2010-12-09 05:55:24 +00:00
|
|
|
App::uses('I18n', 'I18n');
|
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
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function 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(
|
2011-04-17 10:35:21 +00:00
|
|
|
'locales' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Locale' . DS),
|
|
|
|
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
|
2009-07-26 01:27:02 +00:00
|
|
|
), true);
|
2011-05-09 05:06:52 +00:00
|
|
|
CakePlugin::loadAll();
|
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
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function 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
|
|
|
|
2010-09-14 02:17:05 +00:00
|
|
|
|
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');
|
2011-04-29 15:49:33 +00:00
|
|
|
$i18n = i18n::getInstance();
|
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_');
|
2010-09-21 18:45:57 +00:00
|
|
|
$lang = Configure::read('Config.language');#$i18n->l10n->locale;
|
2010-09-14 02:17:05 +00:00
|
|
|
|
|
|
|
Cache::config('_cake_core_', Cache::config('default'));
|
|
|
|
|
|
|
|
// make some calls to translate using different domains
|
2011-05-26 14:54:31 +00:00
|
|
|
$this->assertEqual('Dom 1 Foo', I18n::translate('dom1.foo', false, 'dom1'));
|
|
|
|
$this->assertEqual('Dom 1 Bar', I18n::translate('dom1.bar', false, 'dom1'));
|
2010-09-25 03:27:22 +00:00
|
|
|
$domains = I18n::domains();
|
2011-05-26 14:54:31 +00:00
|
|
|
$this->assertEqual('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_');
|
2011-05-26 14:54:31 +00:00
|
|
|
$this->assertEqual('Dom 1 Foo', $cachedDom1['LC_MESSAGES']['dom1.foo']);
|
|
|
|
$this->assertEqual('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-05-26 14:54:31 +00:00
|
|
|
$this->assertEqual('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_');
|
2011-05-26 14:54:31 +00:00
|
|
|
$this->assertEqual('Dom 2 Foo', $cachedDom2['LC_MESSAGES']['dom2.foo']);
|
|
|
|
$this->assertEqual('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
|
2010-09-21 18:45:57 +00:00
|
|
|
$cachedDom1['LC_MESSAGES']['dom1.foo'] = 'FOO';
|
|
|
|
Cache::write('dom1_' . $lang, $cachedDom1, '_cake_core_');
|
2011-05-26 14:54:31 +00:00
|
|
|
$this->assertEqual('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
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testDefaultStrings() {
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 1', $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
|
|
|
$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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 1 (from core)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
* @access public
|
|
|
|
* @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');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 0 (translated)', $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
|
|
|
$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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 0 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
/**
|
|
|
|
* testMoRulesZero method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @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');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 0 (translated)', $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
|
|
|
$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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 0 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
* @access public
|
|
|
|
* @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');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 1 (translated)', $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
|
|
|
$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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 1 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
|
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
|
|
|
* @access public
|
|
|
|
* @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');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 1 (translated)', $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
|
|
|
$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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 1 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
|
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
|
|
|
* @access public
|
|
|
|
* @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');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 2 (translated)', $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
|
|
|
$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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 2 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
/**
|
|
|
|
* testMoRulesTwo method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testMoRulesTwo() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_2_mo');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 2 (translated)', $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
|
|
|
$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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 2 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
* @access public
|
|
|
|
* @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');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 3 (translated)', $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
|
|
|
$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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 3 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
/**
|
|
|
|
* testMoRulesThree method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testMoRulesThree() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_3_mo');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 3 (translated)', $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
|
|
|
$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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 3 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
/**
|
|
|
|
* testPoRulesFour method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testPoRulesFour() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_4_po');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 4 (translated)', $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
|
|
|
$plurals = $this->__plural();
|
2008-05-30 11:40:08 +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));
|
|
|
|
$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 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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 4 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
/**
|
|
|
|
* testMoRulesFour method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testMoRulesFour() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_4_mo');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 4 (translated)', $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
|
|
|
$plurals = $this->__plural();
|
2008-05-30 11:40:08 +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));
|
|
|
|
$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 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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 4 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
* @access public
|
|
|
|
* @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');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 5 (translated)', $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
|
|
|
$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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 5 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
/**
|
|
|
|
* testMoRulesFive method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @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');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 5 (translated)', $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
|
|
|
$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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 5 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
* @access public
|
|
|
|
* @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');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 6 (translated)', $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
|
|
|
$plurals = $this->__plural();
|
2008-05-30 11:40:08 +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));
|
|
|
|
$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 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));
|
|
|
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 6 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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));
|
|
|
|
$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 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));
|
|
|
|
$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
|
|
|
/**
|
|
|
|
* testMoRulesSix method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testMoRulesSix() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_6_mo');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 6 (translated)', $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
|
|
|
$plurals = $this->__plural();
|
2008-05-30 11:40:08 +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));
|
|
|
|
$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 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));
|
|
|
|
$this->assertTrue(in_array('25 everything else (translated)', $plurals));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 6 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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));
|
|
|
|
$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 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));
|
|
|
|
$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
|
|
|
/**
|
|
|
|
* testPoRulesSeven method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testPoRulesSeven() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_7_po');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 7 (translated)', $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
|
|
|
$plurals = $this->__plural();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('1 ends in 1, not 11 (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));
|
|
|
|
$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 in 1, not 11 (translated)', $plurals));
|
|
|
|
$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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 7 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('1 ends in 1, not 11 (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));
|
|
|
|
$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 in 1, not 11 (from core translated)', $corePlurals));
|
|
|
|
$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
|
|
|
/**
|
|
|
|
* testMoRulesSeven method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testMoRulesSeven() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_7_mo');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 7 (translated)', $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
|
|
|
$plurals = $this->__plural();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertTrue(in_array('0 everything else (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('1 ends in 1, not 11 (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));
|
|
|
|
$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 in 1, not 11 (translated)', $plurals));
|
|
|
|
$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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 7 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('1 ends in 1, not 11 (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));
|
|
|
|
$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 in 1, not 11 (from core translated)', $corePlurals));
|
|
|
|
$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
|
|
|
/**
|
|
|
|
* testPoRulesEight method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testPoRulesEight() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_8_po');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 8 (translated)', $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
|
|
|
$plurals = $this->__plural();
|
2008-05-30 11:40:08 +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-4 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('3 is 2-4 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('4 is 2-4 (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 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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 8 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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-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));
|
|
|
|
$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
|
|
|
/**
|
|
|
|
* testMoRulesEight method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testMoRulesEight() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_8_mo');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 8 (translated)', $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
|
|
|
$plurals = $this->__plural();
|
2008-05-30 11:40:08 +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-4 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('3 is 2-4 (translated)', $plurals));
|
|
|
|
$this->assertTrue(in_array('4 is 2-4 (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 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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 8 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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-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));
|
|
|
|
$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
|
|
|
/**
|
|
|
|
* testPoRulesNine method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testPoRulesNine() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_9_po');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 9 (translated)', $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
|
|
|
$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));
|
|
|
|
$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));
|
|
|
|
$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 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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 9 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
|
|
|
$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));
|
|
|
|
$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 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
|
|
|
/**
|
|
|
|
* testMoRulesNine method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testMoRulesNine() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_9_po');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 9 (translated)', $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
|
|
|
$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));
|
|
|
|
$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));
|
|
|
|
$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 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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 9 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
|
|
|
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
|
|
|
$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));
|
|
|
|
$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 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
|
|
|
/**
|
|
|
|
* testPoRulesTen method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testPoRulesTen() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_10_po');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 10 (translated)', $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
|
|
|
$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));
|
|
|
|
$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));
|
|
|
|
$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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 10 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
|
|
|
$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));
|
|
|
|
$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
|
|
|
/**
|
|
|
|
* testMoRulesTen method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testMoRulesTen() {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'rule_10_mo');
|
|
|
|
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Plural Rule 10 (translated)', $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
|
|
|
$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));
|
|
|
|
$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));
|
|
|
|
$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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 10 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$this->assertTrue(in_array('0 everything else (from core translated)', $corePlurals));
|
|
|
|
$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));
|
|
|
|
$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
|
|
|
/**
|
|
|
|
* testPoRulesEleven method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testPoRulesEleven() {
|
2008-10-10 00:39:01 +00:00
|
|
|
Configure::write('Config.language', 'rule_11_po');
|
2008-05-30 11:40:08 +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 = $this->__singular();
|
2008-10-10 00:39:01 +00:00
|
|
|
$this->assertEqual('Plural Rule 11 (translated)', $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
|
|
|
$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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 11 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
/**
|
|
|
|
* testMoRulesEleven method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-02 19:22:55 +00:00
|
|
|
* @access public
|
|
|
|
* @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');
|
|
|
|
|
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 = $this->__singular();
|
2008-10-10 00:39:01 +00:00
|
|
|
$this->assertEqual('Plural Rule 11 (translated)', $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
|
|
|
$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
|
|
|
|
2008-10-10 00:39:01 +00:00
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 11 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
* @access public
|
|
|
|
* @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');
|
|
|
|
|
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 = $this->__singular();
|
2008-10-10 00:39:01 +00:00
|
|
|
$this->assertEqual('Plural Rule 12 (translated)', $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
|
|
|
$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));
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2008-10-10 00:39:01 +00:00
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 12 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
|
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
|
|
|
* @access public
|
|
|
|
* @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');
|
2008-05-30 11:40:08 +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 = $this->__singular();
|
2008-10-10 00:39:01 +00:00
|
|
|
$this->assertEqual('Plural Rule 12 (translated)', $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
|
|
|
$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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 12 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
|
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
|
|
|
* @access public
|
|
|
|
* @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');
|
|
|
|
|
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 = $this->__singular();
|
2008-10-10 00:39:01 +00:00
|
|
|
$this->assertEqual('Plural Rule 13 (translated)', $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
|
|
|
$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
|
|
|
|
2008-10-10 00:39:01 +00:00
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 13 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
|
2008-06-05 15:20:45 +00:00
|
|
|
/**
|
|
|
|
* testMoRulesThirteen method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testMoRulesThirteen() {
|
2008-10-10 00:39:01 +00:00
|
|
|
Configure::write('Config.language', 'rule_13_mo');
|
|
|
|
|
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 = $this->__singular();
|
2008-10-10 00:39:01 +00:00
|
|
|
$this->assertEqual('Plural Rule 13 (translated)', $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
|
|
|
$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
|
|
|
|
2008-10-10 00:39:01 +00:00
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 13 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
|
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
|
|
|
* @access public
|
|
|
|
* @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');
|
|
|
|
|
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 = $this->__singular();
|
2008-10-10 00:39:01 +00:00
|
|
|
$this->assertEqual('Plural Rule 14 (translated)', $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
|
|
|
$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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 14 (from core translated)', $coreSingular);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2008-10-10 00:39:01 +00:00
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
/**
|
|
|
|
* testMoRulesFourteen method
|
2008-06-23 00:27:33 +00:00
|
|
|
*
|
2008-06-05 15:20:45 +00:00
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testMoRulesFourteen() {
|
2008-10-10 00:39:01 +00:00
|
|
|
Configure::write('Config.language', 'rule_14_mo');
|
|
|
|
|
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 = $this->__singular();
|
2008-10-10 00:39:01 +00:00
|
|
|
$this->assertEqual('Plural Rule 14 (translated)', $singular);
|
2008-05-30 11:40:08 +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
|
|
|
$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));
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertEqual('Plural Rule 14 (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testSetLanguageWithSession () {
|
2008-05-30 11:40:08 +00:00
|
|
|
$_SESSION['Config']['language'] = 'po';
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Po (translated)', $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
|
|
|
$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));
|
|
|
|
unset($_SESSION['Config']['language']);
|
|
|
|
}
|
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
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testNoCoreTranslation () {
|
2008-05-30 11:40:08 +00:00
|
|
|
Configure::write('Config.language', 'po');
|
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 = $this->__singular();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->assertEqual('Po (translated)', $singular);
|
|
|
|
|
|
|
|
$coreSingular = $this->__singularFromCore();
|
|
|
|
$this->assertNotEqual('Po (from core translated)', $coreSingular);
|
|
|
|
|
|
|
|
$corePlurals = $this->__pluralFromCore();
|
|
|
|
$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
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testPluginTranslation() {
|
2009-06-11 16:13:16 +00:00
|
|
|
App::build(array(
|
2011-04-17 10:35:21 +00:00
|
|
|
'plugins' => 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');
|
|
|
|
$singular = $this->__domainSingular();
|
|
|
|
$this->assertEqual('Plural Rule 1 (from plugin)', $singular);
|
|
|
|
|
|
|
|
$plurals = $this->__domainPlural();
|
|
|
|
$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
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +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-05-16 22:49:00 +00:00
|
|
|
$this->assertEqual($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-05-16 22:49:00 +00:00
|
|
|
$this->assertEqual($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-05-16 22:49:00 +00:00
|
|
|
$this->assertEqual($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-05-16 22:49:00 +00:00
|
|
|
$this->assertEqual($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-05-16 22:49:00 +00:00
|
|
|
$this->assertEqual($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-05-16 22:49:00 +00:00
|
|
|
$this->assertEqual($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-05-16 22:49:00 +00:00
|
|
|
$this->assertEqual($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-05-16 22:49:00 +00:00
|
|
|
$this->assertEqual($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
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +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-05-26 14:54:31 +00:00
|
|
|
$this->assertEqual('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
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-05-30 20:02:32 +00:00
|
|
|
public function testPoQuotedString () {
|
2008-06-23 00:27:33 +00:00
|
|
|
$expected = 'this is a "quoted string" (translated)';
|
2011-05-26 14:54:31 +00:00
|
|
|
$this->assertEqual($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
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @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-05-16 22:49:00 +00:00
|
|
|
$this->assertEqual($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-05-16 22:49:00 +00:00
|
|
|
$this->assertEqual($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-05-16 22:49:00 +00:00
|
|
|
$this->assertEqual($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
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @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');
|
|
|
|
$category = $this->__category();
|
|
|
|
$this->assertEqual('Monetary Po (translated)', $category);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-07-03 15:54:26 +00:00
|
|
|
/**
|
|
|
|
* testPluginCategory method
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @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');
|
|
|
|
|
|
|
|
$singular = $this->__domainCategorySingular();
|
|
|
|
$this->assertEqual('Monetary Plural Rule 1 (from plugin)', $singular);
|
|
|
|
|
|
|
|
$plurals = $this->__domainCategoryPlural();
|
|
|
|
$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
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @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');
|
|
|
|
$category = $this->__category();
|
|
|
|
$this->assertEqual('Monetary Po (translated)', $category);
|
|
|
|
|
|
|
|
$singular = $this->__singular();
|
|
|
|
$this->assertEqual('Po (translated)', $singular);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
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-05-16 22:49:00 +00:00
|
|
|
$this->assertEqual($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-05-16 22:49:00 +00:00
|
|
|
$this->assertEqual($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-05-16 22:49:00 +00:00
|
|
|
$this->assertEqual($expected, $result);
|
2009-11-17 00:00:10 +00:00
|
|
|
}
|
|
|
|
|
2011-05-30 20:02:32 +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-05-16 22:49:00 +00:00
|
|
|
$this->assertEqual($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-05-16 22:49:00 +00:00
|
|
|
$this->assertEqual($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-05-16 22:49:00 +00:00
|
|
|
$this->assertEqual($expected, $result);
|
2010-03-03 02:42:53 +00:00
|
|
|
}
|
|
|
|
|
2009-07-03 15:54:26 +00:00
|
|
|
/**
|
|
|
|
* Singular method
|
|
|
|
*
|
|
|
|
* @access private
|
|
|
|
* @return void
|
|
|
|
*/
|
2009-10-22 10:34:25 +00:00
|
|
|
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
|
|
|
|
*
|
|
|
|
* @access private
|
|
|
|
* @return void
|
|
|
|
*/
|
2009-10-22 10:34:25 +00:00
|
|
|
function __domainCategoryPlural($domain = 'test_plugin', $category = 3) {
|
2009-07-03 15:54:26 +00:00
|
|
|
$plurals = array();
|
|
|
|
for ($number = 0; $number <= 25; $number++) {
|
2010-04-15 16:38:12 +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
|
|
|
* @access private
|
|
|
|
* @return void
|
|
|
|
*/
|
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
|
|
|
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
|
|
|
|
*
|
|
|
|
* @access private
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function __domainPlural($domain = 'test_plugin') {
|
|
|
|
$plurals = array();
|
|
|
|
for ($number = 0; $number <= 25; $number++) {
|
2010-04-15 16:38:12 +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
|
|
|
|
*
|
|
|
|
* @access private
|
|
|
|
* @return void
|
|
|
|
*/
|
2009-10-22 10:34:25 +00:00
|
|
|
function __category($category = 3) {
|
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
|
|
|
|
*
|
|
|
|
* @access private
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
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
|
|
|
* @access private
|
|
|
|
* @return void
|
|
|
|
*/
|
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
|
|
|
function __plural() {
|
2008-05-30 11:40:08 +00:00
|
|
|
$plurals = array();
|
|
|
|
for ($number = 0; $number <= 25; $number++) {
|
2010-04-15 16:38:12 +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
|
|
|
* @access private
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
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
|
|
|
* @access private
|
|
|
|
* @return void
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
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++) {
|
2010-04-15 16:38:12 +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;
|
|
|
|
}
|
|
|
|
}
|