2008-05-30 11:40:08 +00:00
|
|
|
<?php
|
|
|
|
/* SVN FILE: $Id$ */
|
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 file
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
|
|
|
* Long description for file
|
|
|
|
*
|
|
|
|
* PHP versions 4 and 5
|
|
|
|
*
|
|
|
|
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
|
2008-10-30 17:30:26 +00:00
|
|
|
* Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
|
|
|
* Licensed under The Open Group Test Suite License
|
|
|
|
* Redistributions of files must retain the above copyright notice.
|
|
|
|
*
|
|
|
|
* @filesource
|
2008-10-30 17:30:26 +00:00
|
|
|
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
|
|
|
|
* @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs
|
|
|
|
* @since CakePHP(tm) v 1.2.0.5432
|
|
|
|
* @version $Revision$
|
|
|
|
* @modifiedby $LastChangedBy$
|
|
|
|
* @lastmodified $Date$
|
|
|
|
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
App::import('Core', '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
|
|
|
*
|
2009-03-18 17:55:58 +00:00
|
|
|
* @package cake
|
2008-10-30 17:30:26 +00:00
|
|
|
* @subpackage cake.tests.cases.libs
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
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(
|
2009-10-14 04:51:55 +00:00
|
|
|
'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS),
|
|
|
|
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
|
2009-07-26 01:27:02 +00:00
|
|
|
), true);
|
|
|
|
App::objects('plugin', null, false);
|
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
|
|
|
|
*/
|
|
|
|
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();
|
2009-07-26 01:27:02 +00:00
|
|
|
App::objects('plugin', null, false);
|
2009-03-21 23:55:39 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testPoRulesZero() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testMoRulesZero() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testPoRulesOne() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testMoRulesOne() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testPoRulesTwo() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testMoRulesTwo() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testPoRulesThree() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testMoRulesThree() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testPoRulesFour() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testMoRulesFour() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testPoRulesFive() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testMoRulesFive() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testPoRulesSix() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testMoRulesSix() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testPoRulesSeven() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testMoRulesSeven() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testPoRulesEight() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testMoRulesEight() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testPoRulesNine() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testMoRulesNine() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testPoRulesTen() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testMoRulesTen() {
|
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testSetLanguageWithSession () {
|
|
|
|
$_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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testNoCoreTranslation () {
|
|
|
|
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
|
|
|
|
*/
|
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 testPluginTranslation() {
|
2009-06-11 16:13:16 +00:00
|
|
|
App::build(array(
|
2009-10-14 04:51:55 +00:00
|
|
|
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . 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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testPoMultipleLineTranslation () {
|
|
|
|
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.";
|
|
|
|
$result = __($string, true);
|
|
|
|
|
|
|
|
$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)";
|
|
|
|
$this->assertEqual($result, $expected);
|
|
|
|
|
|
|
|
// 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.";
|
2008-05-30 11:40:08 +00:00
|
|
|
$result = __($string, true);
|
|
|
|
$this->assertEqual($result, $expected);
|
2008-10-28 01:51:18 +00:00
|
|
|
|
2008-11-06 22:57:50 +00:00
|
|
|
$singular = "valid\nsecond line";
|
|
|
|
$plural = "valids\nsecond line";
|
|
|
|
|
|
|
|
$result = __n($singular, $plural, 1, true);
|
|
|
|
$expected = "v\nsecond line";
|
|
|
|
$this->assertEqual($result, $expected);
|
|
|
|
|
|
|
|
$result = __n($singular, $plural, 2, true);
|
|
|
|
$expected = "vs\nsecond line";
|
|
|
|
$this->assertEqual($result, $expected);
|
|
|
|
|
|
|
|
$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;
|
|
|
|
|
|
|
|
$result = __n($singular, $plural, 1, true);
|
|
|
|
$expected = "%d is 1\n" . $string;
|
|
|
|
$this->assertEqual($result, $expected);
|
|
|
|
|
|
|
|
$result = __n($singular, $plural, 2, true);
|
|
|
|
$expected = "%d is 2-4\n" . $string;
|
|
|
|
$this->assertEqual($result, $expected);
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
|
|
$result = __n($singular, $plural, 1, true);
|
2008-11-06 22:57:50 +00:00
|
|
|
$expected = "%d is 1\n" . str_replace("\r\n", "\n", $string);
|
2008-10-28 01:51:18 +00:00
|
|
|
$this->assertEqual($result, $expected);
|
|
|
|
|
|
|
|
$result = __n($singular, $plural, 2, true);
|
2008-11-06 22:57:50 +00:00
|
|
|
$expected = "%d is 2-4\n" . str_replace("\r\n", "\n", $string);
|
2008-10-28 01:51:18 +00:00
|
|
|
$this->assertEqual($result, $expected);
|
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
|
|
|
|
*/
|
2008-05-30 11:40:08 +00:00
|
|
|
function testPoNoTranslationNeeded () {
|
|
|
|
Configure::write('Config.language', 'po');
|
|
|
|
$result = __('No Translation needed', true);
|
|
|
|
$this->assertEqual($result, 'No Translation needed');
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-06-23 00:27:33 +00:00
|
|
|
/**
|
|
|
|
* testPoQuotedString method
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function testPoQuotedString () {
|
|
|
|
$expected = 'this is a "quoted string" (translated)';
|
|
|
|
$this->assertEqual(__('this is a "quoted string"', true), $expected);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-07-03 15:54:26 +00:00
|
|
|
/**
|
|
|
|
* testFloatValue method
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @return void
|
|
|
|
*/
|
2009-02-18 01:01:39 +00:00
|
|
|
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
|
|
|
|
|
|
|
$result = __n('%d = 1', '%d = 0 or > 1', (float)1, true);
|
2009-02-18 01:23:42 +00:00
|
|
|
$expected = '%d is 1 (translated)';
|
|
|
|
$this->assertEqual($result, $expected);
|
2009-02-18 01:01:39 +00:00
|
|
|
|
|
|
|
$result = __n('%d = 1', '%d = 0 or > 1', (float)2, true);
|
2009-02-18 01:23:42 +00:00
|
|
|
$expected = "%d ends in 2-4, not 12-14 (translated)";
|
|
|
|
$this->assertEqual($result, $expected);
|
2009-02-18 01:01:39 +00:00
|
|
|
|
|
|
|
$result = __n('%d = 1', '%d = 0 or > 1', (float)5, true);
|
2009-02-18 01:23:42 +00:00
|
|
|
$expected = "%d everything else (translated)";
|
|
|
|
$this->assertEqual($result, $expected);
|
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
|
|
|
|
*/
|
|
|
|
function testCategory() {
|
|
|
|
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
|
|
|
|
*/
|
|
|
|
function testPluginCategory() {
|
|
|
|
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
|
|
|
|
*/
|
|
|
|
function testCategoryThenSingular() {
|
|
|
|
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
|
|
|
|
2009-07-03 15:54:26 +00:00
|
|
|
/**
|
|
|
|
* Singular method
|
|
|
|
*
|
|
|
|
* @access private
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function __domainCategorySingular($domain = 'test_plugin', $category = LC_MONETARY) {
|
|
|
|
$singular = __dc($domain, 'Plural Rule 1', $category, true);
|
|
|
|
return $singular;
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-07-03 15:54:26 +00:00
|
|
|
/**
|
|
|
|
* Plural method
|
|
|
|
*
|
|
|
|
* @access private
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function __domainCategoryPlural($domain = 'test_plugin', $category = LC_MONETARY) {
|
|
|
|
$plurals = array();
|
|
|
|
for ($number = 0; $number <= 25; $number++) {
|
|
|
|
$plurals[] = sprintf(__dcn($domain, '%d = 1', '%d = 0 or > 1', (float)$number, $category, true), (float)$number);
|
|
|
|
}
|
|
|
|
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') {
|
|
|
|
$singular = __d($domain, 'Plural Rule 1', true);
|
|
|
|
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++) {
|
2009-02-18 01:23:42 +00:00
|
|
|
$plurals[] = sprintf(__dn($domain, '%d = 1', '%d = 0 or > 1', (float)$number, true), (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
|
|
|
|
*/
|
|
|
|
function __category($category = LC_MONETARY) {
|
|
|
|
$singular = __c('Plural Rule 1', $category, true);
|
|
|
|
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() {
|
2008-05-30 11:40:08 +00:00
|
|
|
$singular = __('Plural Rule 1', true);
|
|
|
|
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++) {
|
2009-02-18 01:23:42 +00:00
|
|
|
$plurals[] = sprintf(__n('%d = 1', '%d = 0 or > 1', (float)$number, true), (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() {
|
|
|
|
$singular = __('Plural Rule 1 (from core)', true);
|
|
|
|
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++) {
|
2009-02-18 01:23:42 +00:00
|
|
|
$plurals[] = sprintf(__n('%d = 1 (from core)', '%d = 0 or > 1 (from core)', (float)$number, true), (float)$number );
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
return $plurals;
|
|
|
|
}
|
|
|
|
}
|
2008-06-23 00:27:33 +00:00
|
|
|
?>
|