[Catalyst] Proper ngettext with Catalyst

Felix Antonius Wilhelm Ostmann ostmann at websuche.de
Mon Feb 2 10:58:46 GMT 2009


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.


And with the zero-Form, i think in every language it is possible to say 
it with the number and dont build a new phrase. Sure, it will be more 
correct if you say: "I haven't seen any boy", but "I have seen 0 boys." 
is also correct and will work perfect.



J. Shirley schrieb:
> On Sun, Feb 1, 2009 at 1:27 PM, Octavian Rasnita <orasnita at gmail.com> wrote:
>   
>> From: "Kieren Diment" <diment at gmail.com>
>>     
>>> In indonesian, to pluralise you just say the word twice, or in writing put
>>> a 2 after it.
>>>
>>> I have two apples:
>>> Saya ada dua appel appel.
>>> or:
>>> Saya ada dua appel2
>>>
>>>       
>> "Saya ada [quant,_1,appel,appel appel]."
>>
>> But it doesn't do a perfect translation this way, because instead of "dua"
>> it just puts 2, which is not very nice in some languages.
>>
>> For example, in Romanian some numerals depend if the noun is masculine or
>> feminine:
>> 1 is "unu" for masculine and "una" for feminine nouns.
>> 2 is "doi" for masculin and "doua" for feminine nouns.
>> And it also depends for 21, 22, 31, 32, and so on, but these bigger numbers
>> are usually written as numbers because they are too longer otherwise.
>>
>> For 1 and 2 however, in many cases they are written as words because it is
>> much clear.
>>
>> Another problem is the case of 0 because in English is easy but in other
>> languages the structure of the sentence is totally different.
>>
>> For example:
>> I have seen 1 boy.
>> I have seen 2 boys.
>> I have seen no boys.
>>
>> But in Romanian it should be:
>> Am vazut 1 baiat.
>> Am vazut 2 baieti.
>> Nu am vazut nici un baiat.
>>
>> Of course, in English works but it is not very nice either. It should have
>> been "I haven't seen any boy" or something like that.
>>
>> Octavian
>>
>>
>>
>>
>>
>>
>>     
>
> All of this just makes me feel sane in my choice to organize my IDs
> using generic stubs if they have quantitites, as well as having more
> "friendly" apps:
>
> [% IF banana_count;
>     c.loc("Banana Count", [ banana_count ]);
> ELSE;
>    c.loc("I have no bananas");
> END %]
>
> More long-winded, but I like being able to have special branching if
> there is an absence of things (it's also a good moment to invite the
> user to participate more in the site)
>
> -J
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>
>   


-- 
Mit freundlichen Grüßen

Felix Antonius Wilhelm Ostmann
--------------------------------------------------
Websuche   Search   Technology   GmbH   &   Co. KG
Martinistraße 3  -  D-49080  Osnabrück  -  Germany
Tel.:   +49 541 40666-0 - Fax:    +49 541 40666-22
Email: info at websuche.de - Website: www.websuche.de
--------------------------------------------------
AG Osnabrück - HRA 200252 - Ust-Ident: DE814737310
Komplementärin:     Websuche   Search   Technology
Verwaltungs GmbH   -  AG Osnabrück  -   HRB 200359
Geschäftsführer:  Diplom Kaufmann Martin Steinkamp
--------------------------------------------------




More information about the Catalyst mailing list