From 3ab9854300db06bc2ebaaff18f5b1863f41eaafd Mon Sep 17 00:00:00 2001 From: "renan.saddam" Date: Tue, 28 Oct 2008 01:51:18 +0000 Subject: [PATCH] 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 --- cake/tests/cases/libs/i18n.test.php | 13 +++++++++++-- .../tests/test_app/locale/po/LC_MESSAGES/default.po | 5 +++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/cake/tests/cases/libs/i18n.test.php b/cake/tests/cases/libs/i18n.test.php index 7fd78f048..326c4c12f 100644 --- a/cake/tests/cases/libs/i18n.test.php +++ b/cake/tests/cases/libs/i18n.test.php @@ -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 diff --git a/cake/tests/test_app/locale/po/LC_MESSAGES/default.po b/cake/tests/test_app/locale/po/LC_MESSAGES/default.po index 570753dda..1230c7412 100644 --- a/cake/tests/test_app/locale/po/LC_MESSAGES/default.po +++ b/cake/tests/test_app/locale/po/LC_MESSAGES/default.po @@ -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)" \ No newline at end of file