It's useful to know how the .po-file has to look like when using ngettext:
msgid "item"
msgid_plural "items"
msgstr[0] "Produkt"
msgstr[1] "Produkte"
In php:
echo ngettext('item', 'items', $number);
![]() |
|
||||||||||
|
ngettextОписаниеstring ngettext ( string msgid1, string msgid2, int n )
Возвращает сообщение в соответствующей числу форме. В английском языке
есть только два варианта -
ngettext
kontakt at somplatzki dot de
25-May-2007 02:47
It's useful to know how the .po-file has to look like when using ngettext:
tokul at users dot sourceforge dot net
10-Dec-2006 03:56
According to GNU gettext manual third argument is unsigned long integer. It must be positive number. If n is negative, it might be evaluated incorrectly in some languages.
nikolai dot zujev at gmail dot com
21-Mar-2006 01:36
This is an implementation for a word ending in russian lang. Also as I know polish and similar langs use same rules:
mike-php at emerge2 dot com
03-Nov-2004 12:53
Section 10.2.5 in the GNU gettext manual explains the ngettext function: |