We need to use ngettext() for the method name, otherwise the gettext tools don't...
authorJan Schneider <jan@horde.org>
Tue, 12 Oct 2010 21:15:31 +0000 (23:15 +0200)
committerJan Schneider <jan@horde.org>
Wed, 13 Oct 2010 00:34:40 +0000 (02:34 +0200)
framework/Block/lib/Horde/Block/Layout/Manager.php
framework/Core/lib/Horde/Core/Auth/Application.php
framework/Core/lib/Horde/Core/Mime/Viewer/Vcard.php
framework/Date/lib/Horde/Date/Utils.php
framework/Form/Form/Type.php
framework/Mime_Viewer/lib/Horde/Mime/Viewer/Rar.php
framework/Mime_Viewer/lib/Horde/Mime/Viewer/Tgz.php
framework/Mime_Viewer/lib/Horde/Mime/Viewer/Zip.php
framework/Translation/lib/Horde/Translation/Gettext.php

index 2b16825..e740a65 100644 (file)
@@ -242,7 +242,7 @@ class Horde_Block_Layout_Manager extends Horde_Block_Layout
                     try {
                         $message = Horde::callHook('perms_denied', array('horde:max_blocks'));
                     } catch (Horde_Exception_HookNotSet $e) {
-                        $message = htmlspecialchars(sprintf($this->_dict->n("You are not allowed to create more than %d block.", "You are not allowed to create more than %d blocks.", $max_blocks), $max_blocks));
+                        $message = htmlspecialchars(sprintf($this->_dict->ngettext("You are not allowed to create more than %d block.", "You are not allowed to create more than %d blocks.", $max_blocks), $max_blocks));
                     }
                     $GLOBALS['notification']->push($message, 'horde.error', array('content.raw'));
                     break;
index 2d4e0ec..a31bd3d 100644 (file)
@@ -580,7 +580,7 @@ class Horde_Core_Auth_Application extends Horde_Auth_Base
             isset($GLOBALS['notification']) &&
             ($expire = $this->_base->getCredential('expire'))) {
             $toexpire = ($expire - time()) / 86400;
-            $GLOBALS['notification']->push(sprintf($this->_coreDict->n("%d day until your password expires.", "%d days until your password expires.", $toexpire), $toexpire), 'horde.warning');
+            $GLOBALS['notification']->push(sprintf($this->_coreDict->ngettext("%d day until your password expires.", "%d days until your password expires.", $toexpire), $toexpire), 'horde.warning');
         }
 
         if ($this->hasCapability('authenticatecallback')) {
index c16b05a..424794f 100644 (file)
@@ -130,7 +130,7 @@ class Horde_Core_Mime_Viewer_Vcard extends Horde_Mime_Viewer_Base
                     }
                 }
             }
-            $notification->push(sprintf($this->_coreDict->n(
+            $notification->push(sprintf($this->_coreDict->ngettext(
                 "%d contact was successfully added to your address book.",
                 "%d contacts were successfully added to your address book.",
                 $count),
index 49df5fe..bfa2b5a 100644 (file)
@@ -84,16 +84,16 @@ class Horde_Date_Utils
 
         $delta = time() - $timestamp;
         if ($delta < 60) {
-            return sprintf($dict->n("%d second ago", "%d seconds ago", $delta), $delta);
+            return sprintf($dict->ngettext("%d second ago", "%d seconds ago", $delta), $delta);
         }
         $delta = round($delta / 60);
         if ($delta < 60) {
-            return sprintf($dict->n("%d minute ago", "%d minutes ago", $delta), $delta);
+            return sprintf($dict->ngettext("%d minute ago", "%d minutes ago", $delta), $delta);
         }
 
         $delta = round($delta / 60);
         if ($delta < 24) {
-            return sprintf($dict->n("%d hour ago", "%d hours ago", $delta), $delta);
+            return sprintf($dict->ngettext("%d hour ago", "%d hours ago", $delta), $delta);
         }
 
         if ($delta > 24 && $delta < 48) {
@@ -108,7 +108,7 @@ class Horde_Date_Utils
 
         if (round($delta / 7) < 5) {
             $delta = round($delta / 7);
-            return sprintf($dict->n("%d week ago", "%d weeks ago", $delta), $delta);
+            return sprintf($dict->ngettext("%d week ago", "%d weeks ago", $delta), $delta);
         }
 
         // Default to the user specified date format.
index 24a3a92..f20748f 100644 (file)
@@ -641,7 +641,7 @@ class Horde_Form_Type_countedtext extends Horde_Form_Type_longtext {
             $message = $this->_dict->t("This field is required.");
         } elseif ($length > $this->_chars) {
             $valid = false;
-            $message = sprintf($this->_dict->n("There are too many characters in this field. You have entered %d character; ", "There are too many characters in this field. You have entered %d characters; ", $length), $length)
+            $message = sprintf($this->_dict->ngettext("There are too many characters in this field. You have entered %d character; ", "There are too many characters in this field. You have entered %d characters; ", $length), $length)
                 . sprintf($this->_dict->t("you must enter less than %d."), $this->_chars);
         }
 
index e221ac5..2fff6db 100644 (file)
@@ -92,7 +92,7 @@ class Horde_Mime_Viewer_Rar extends Horde_Mime_Viewer_Base
                 'encode' => true,
                 'encode_all' => true
             )) . "\n" .
-            $this->_textFilter(sprintf($this->_dict->n("File Count: %d file", "File Count: %d files", $fileCount), $fileCount), 'space2html', array(
+            $this->_textFilter(sprintf($this->_dict->ngettext("File Count: %d file", "File Count: %d files", $fileCount), $fileCount), 'space2html', array(
                 'charset' => $charset,
                 'encode' => true,
                 'encode_all' => true
index b5a1042..2467358 100644 (file)
@@ -110,7 +110,7 @@ class Horde_Mime_Viewer_Tgz extends Horde_Mime_Viewer_Base
                 'encode' => true,
                 'encode_all' => true
             )) . "\n" .
-            $this->_textFilter(sprintf($this->_dict->n("File Count: %d file", "File Count: %d files", $fileCount), $fileCount), 'Space2html', array(
+            $this->_textFilter(sprintf($this->_dict->ngettext("File Count: %d file", "File Count: %d files", $fileCount), $fileCount), 'Space2html', array(
                 'charset' => $charset,
                 'encode' => true,
                 'encode_all' => true
index d77bdb8..08a3e71 100644 (file)
@@ -98,7 +98,7 @@ class Horde_Mime_Viewer_Zip extends Horde_Mime_Viewer_Base
                 $this->_dict->t("Archive Name") . ': ' . $name . "\n" .
                 $this->_dict->t("Archive File Size") . ': ' . strlen($contents) .
                 " bytes\n" .
-                sprintf($this->_dict->n("File Count: %d file", "File Count: %d files", $fileCount), $fileCount) .
+                sprintf($this->_dict->ngettext("File Count: %d file", "File Count: %d files", $fileCount), $fileCount) .
                 "\n\n" .
                 str_repeat(' ', 15) .
                 Horde_String::pad($this->_dict->t("Attributes"), 10, ' ', STR_PAD_LEFT) .
index e4f06e4..a5078db 100644 (file)
@@ -73,7 +73,7 @@ class Horde_Translation_Gettext implements Horde_Translation
      * @return string  The string translation, or the original string if no
      *                 translation exists.
      */
-    public function n($singular, $plural, $number)
+    public function ngettext($singular, $plural, $number)
     {
         return $this->_gettext
           ? dngettext($this->_domain, $singular, $plural, $number)