[Catalyst] Proper ngettext with Catalyst

J. Shirley jshirley at gmail.com
Sun Feb 1 22:07:36 GMT 2009


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



More information about the Catalyst mailing list