bin/ is the new scripts/.
authorJan Schneider <jan@horde.org>
Fri, 22 Oct 2010 14:11:00 +0000 (16:11 +0200)
committerJan Schneider <jan@horde.org>
Fri, 22 Oct 2010 17:27:03 +0000 (19:27 +0200)
components/bin/horde-components [new file with mode: 0755]
components/script/horde-components.php [deleted file]
framework/Translation/lib/Horde/Translation.php
framework/Translation/test/Horde/Translation/WrapperTest.php

diff --git a/components/bin/horde-components b/components/bin/horde-components
new file mode 100755 (executable)
index 0000000..8bc171f
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/env php
+<?php
+if (strpos('@php_dir@', '@php_dir') === 0) {
+    set_include_path(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'lib' . PATH_SEPARATOR . get_include_path());
+}
+
+/**
+ * We are heavily relying on the PEAR libraries which are not clean with regard
+ * to E_STRICT.
+ */
+if (defined('E_DEPRECATED')) {
+    error_reporting(E_ALL & ~E_STRICT & ~E_DEPRECATED);
+} else {
+    error_reporting(E_ALL & ~E_STRICT);
+}
+
+require_once 'Horde/Autoloader/Default.php';
+Components::main();
diff --git a/components/script/horde-components.php b/components/script/horde-components.php
deleted file mode 100755 (executable)
index 8bc171f..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env php
-<?php
-if (strpos('@php_dir@', '@php_dir') === 0) {
-    set_include_path(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'lib' . PATH_SEPARATOR . get_include_path());
-}
-
-/**
- * We are heavily relying on the PEAR libraries which are not clean with regard
- * to E_STRICT.
- */
-if (defined('E_DEPRECATED')) {
-    error_reporting(E_ALL & ~E_STRICT & ~E_DEPRECATED);
-} else {
-    error_reporting(E_ALL & ~E_STRICT);
-}
-
-require_once 'Horde/Autoloader/Default.php';
-Components::main();
index 4d9cf5d..d45186b 100644 (file)
@@ -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);
     }
index 53402e6..0084b11 100644 (file)
@@ -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);
+    }
 }