NGETTEXT(3) 1 NGETTEXT(3)
ngettext - Plural version of gettext
SYNOPSIS
string ngettext (string $msgid1, string $msgid2, int $n)
DESCRIPTION
The plural version of gettext(3). Some languages have more than one form for plural messages dependent on the count.
PARAMETERS
o $msgid1
-
o $msgid2
-
o $n
-
RETURN VALUES
Returns correct plural form of message identified by $msgid1 and $msgid2 for count $n.
EXAMPLES
Example #1
ngettext(3) example
<?php
setlocale(LC_ALL, 'cs_CZ');
printf(ngettext("%d window", "%d windows", 1), 1); // 1 okno
printf(ngettext("%d window", "%d windows", 2), 2); // 2 okna
printf(ngettext("%d window", "%d windows", 5), 5); // 5 oken
?>
PHP Documentation Group NGETTEXT(3)