[Catalyst] Proper ngettext with Catalyst

Octavian Rasnita orasnita at gmail.com
Mon Feb 2 12:13:37 GMT 2009


From: "Felix Antonius Wilhelm Ostmann" <ostmann at websuche.de>
>i run into the same problem with german phrases
> [quant,_1,message has,messages have]  been sent.
> 
> but in german:
> 
> singular: Es wurde 1 Nachricht gesendet.
> plural: Es wurden 10 Nachrichten gesendet.
> 
> So i cant build that with normal quant ... and i was thinking about a 
> quantf :)
> 
> 
> Es [quantf,_1,wurde %d Nachricht,wurden %d Nachrichten] gesendet.
> 
> That would also fit for other languages where words get shuffled for 
> different counts, right?
> 
> And you can use quantf only in that languages that need that. Others can 
> still use normal quant.

In Locale::Maketext I read that for more complex cases, the quant() method could be overriden.
But making a quantf() method could be very helpful and it could also allow commify the number using the tools offered by Locale::Maketext.

Octavian






More information about the Catalyst mailing list