From 2c90546167ee7ce108584a314d11b780dd568f8b Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Fri, 22 Oct 2010 16:11:00 +0200 Subject: [PATCH] bin/ is the new scripts/. --- .../horde-components.php => bin/horde-components} | 0 framework/Translation/lib/Horde/Translation.php | 2 +- .../Translation/test/Horde/Translation/WrapperTest.php | 17 ++++++++--------- 3 files changed, 9 insertions(+), 10 deletions(-) rename components/{script/horde-components.php => bin/horde-components} (100%) diff --git a/components/script/horde-components.php b/components/bin/horde-components similarity index 100% rename from components/script/horde-components.php rename to components/bin/horde-components diff --git a/framework/Translation/lib/Horde/Translation.php b/framework/Translation/lib/Horde/Translation.php index 4d9cf5d1e..d45186b70 100644 --- a/framework/Translation/lib/Horde/Translation.php +++ b/framework/Translation/lib/Horde/Translation.php @@ -105,7 +105,7 @@ abstract class Horde_Translation static public function ngettext($singular, $plural, $number) { if (!self::$_handler) { - self::loadHandler(); + self::loadHandler('Horde_Translation_Handler_Gettext'); } return self::$_handler->ngettext($singular, $plural, $number); } diff --git a/framework/Translation/test/Horde/Translation/WrapperTest.php b/framework/Translation/test/Horde/Translation/WrapperTest.php index 53402e6c3..0084b112c 100644 --- a/framework/Translation/test/Horde/Translation/WrapperTest.php +++ b/framework/Translation/test/Horde/Translation/WrapperTest.php @@ -13,25 +13,24 @@ class Horde_Translation_WrapperTest extends Horde_Translation_TestBase { public function testWrappers() { - $this->assertEquals('Heute', Horde_Translation_TestWrapper::t('Today')); $this->assertEquals('1 Woche', sprintf(Horde_Translation_TestWrapper::ngettext('%d week', '%d weeks', 1), 1)); + $this->assertEquals('Heute', Horde_Translation_TestWrapper::t('Today')); } } class Horde_Translation_TestWrapper extends Horde_Translation { - /** - * Returns the translation of a message. - * - * @var string $message The string to translate. - * - * @return string The string translation, or the original string if no - * translation exists. - */ static public function t($message) { self::$_domain = 'Horde_Translation'; self::$_directory = 'locale'; return parent::t($message); } + + static public function ngettext($singular, $plural, $number) + { + self::$_domain = 'Horde_Translation'; + self::$_directory = 'locale'; + return parent::ngettext($singular, $plural, $number); + } } -- 2.11.0