--- /dev/null
+#!/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();
+++ /dev/null
-#!/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();
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);
}
{
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);
+ }
}