Amir E. Aharoni wrote:
On 26/01/2008, Larry Wall <[EMAIL PROTECTED]> wrote:
After a recent exchange on PerlMonks about join, I've been thinking
about the problem of pluralization in interpolated strings, where we
get things like:
say "Received $m message{ 1==$m ?? '' !! 's' }."
...
Any other cute ideas?
No matter what you do it will remain too English-centric. It might
work for Catalan, too. But it will remain totally useless for Arabic
or Chinese.
In any case, i don't understand why should this be in the core language at all.
I second that.
A few more thoughts:
1. For example in Hungarian, you don't need this at all: the noun stays
singular after the numeral.
2. AFAIK in some languages it's not "1 ore more", but "1, 2 or more".
3. It's often not "1 or more" what you need, but "none, 1 ore more". "No
new messages - You have 1 new message - You have 3 new messages." Or
more likely "<b>Now new messages.</b> - <a href="/read.asp">You have 1
new message.</a> ..." etc.
4. I work a lot with multilingual websites. I have learned long ago that
it's never "{{you_have}} [% messages %] {{messages}}." You have to be
*very* lucky just to make this work in two languages. Instead, it's
"{{number_of_new_messages}}: [% messages %]." That pretty much works
everywhere.
So not in the core, probably. There are too many exceptions. A module
would be cool, though :) String::Plural::English, or whatnot.
- Fagzal