note 29389 deleted from function.ngettext by nlopess

From: Date: Thu, 04 Nov 2004 17:49:03 +0000
Subject: note 29389 deleted from function.ngettext by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-79628@lists.php.net to get a copy of this message
Note Submitter: Patrice Levesque ---- Since there's no doc... the ngettext function is used somehow like you'd do in a C language context. You must wrap it inside a printf-family function. A typical example: $number = 1; printf(ngettext("%d bird", "%d birds", $number), $number); $number++; printf(ngettext("%d bird", "%d birds", $number), $number); will echo: 1 bird 2 birds Note that the argument has to be fed to both printf and ngettext for this to work.

« previous php.notes (#79628) next »