Source for file ngettext.php
Documentation is available at ngettext.php
* SquirrelMail internal ngettext functions
* Uses php-gettext classes
* @link http://www.php.net/gettext Original php gettext manual
* @link http://savannah.nongnu.org/projects/php-gettext php-gettext classes
* @copyright © 2004-2006 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: ngettext.php,v 1.9 2006/07/15 12:00:45 tokul Exp $
* internal ngettext wrapper.
* provides ngettext support
* @link http://www.php.net/function.ngettext
* @param string $single English string, singular form
* @param string $plural English string, plural form
* @param integer $number number that shows used quantity
* @return string translated string
function ngettext($single, $plural, $number) {
global $l10n, $gettext_domain;
if (! isset
($l10n[$gettext_domain]) ||
$l10n[$gettext_domain]->error==
1)
return ($number==
1 ?
$single :
$plural);
return $l10n[$gettext_domain]->ngettext($single, $plural, $number);
* freaky setup where ngettext is not available and dngettext is available.
* internal dngettext wrapper.
* provides dngettext support
* @link http://www.php.net/function.dngettext
* @param string $domain Gettext domain
* @param string $single English string, singular form
* @param string $plural English string, plural form
* @param integer $number number that shows used quantity
* @return string translated string
function dngettext($domain, $single, $plural, $number) {
// Make sure that $number is integer
// Make sure that domain is initialized
if (! isset
($l10n[$domain]) ||
$l10n[$domain]->error==
1)
return ($number==
1 ?
$single :
$plural);
// use ngettext class function
return $l10n[$domain]->ngettext($single, $plural, $number);
Documentation generated on Sat, 07 Oct 2006 16:12:40 +0300 by phpDocumentor 1.3.0RC6