[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: plural forms in website translations



On Thu, Aug 04, 2005 at 01:18:27PM +0300, Eugeniy Meshcheryakov wrote:
> 3 серпня 2005 о 21:44 +0200 Denis Barbier написав(-ла):
> > this had been requested by #234689, but I did not find a good way to
> > define this <ngettext> tag.
> <ngettext> tag will not help there. It is for translations that use
> po-files, and here I need to translate wml file.
> 
> But I found what I was looking for:
> <perl>
> my $n = <podebconf-total-strings/>;
> my $i = ($n%10==1 && $n%100!=11 ? 0 : $n%10>=2 && $n%10<=4 && ($n%100<10
> || $n%100>=20) ? 1 : 2);
> print (("рядок", "рядки", "рядків")[$i]);
> </perl>

Yes, but similar definitions have to be added for several other
languages, whereas an <ngettext> tag would be cleaner; the needed
sentence could be put into webwml/english/po/l10n.pot
Anyway you are right, this is a good solution for the short term.

Denis



Reply to: