Added test to disprove non-supported multiline plural message. Fixes #5663.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7786 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
renan.saddam 2008-10-28 01:51:18 +00:00
parent 97cd2c5aef
commit 3ab9854300
2 changed files with 16 additions and 2 deletions

View file

@ -2341,8 +2341,6 @@ class I18nTest extends CakeTestCase {
function testPluginTranslation() {
$pluginPaths = Configure::read('pluginPaths');
Configure::write('localPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale'));
Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins'));
Configure::write('Config.language', 'po');
@ -2401,6 +2399,17 @@ This is the third line.
This is the forth line. (translated)
EOD;
$this->assertEqual($result, $expected);
$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);
}
/**
* testPoNoTranslationNeeded method

View file

@ -69,5 +69,10 @@ msgstr[0] "v \n"
msgstr[1] "vs \n"
"second line"
msgid "valid \nsecond line"
msgid_plural "valid \nsecond line"
msgstr[0] "v \nsecond line"
msgstr[1] "vs \nsecond line"
msgid "this is a \"quoted string\""
msgstr "this is a \"quoted string\" (translated)"