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-2020 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: ngettext.php 14845 2020-01-07 08:09:34Z pdontthink $
* 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 Mon, 13 Jan 2020 04:23:11 +0100 by phpDocumentor 1.4.3