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;
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')) {
}
}
}
- $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),
$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) {
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.
$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);
}
'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
'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
$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) .
* @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)