Please take a look at the plural rule for Arabic text then you will
understand the reason for textual aliases.
http://code.google.com/p/google-web-toolkit/source/browse/releases/1.5/user/src/com/google/gwt/i18n/client/impl/plurals/DefaultRule_ar.java
So, we're almost back to aliases.
While I agree with you that there should be a way to override a plural
form by number, I also think that the default implementation shouldn't
force most people to define redundant plural forms, thus the grouping
of "zero" and "other".
I would prefer a combination of both, aliases for grouped selections
and direct selection by number, where numbers override any aliased
selection.
# English
resultsCount = Found {0} results
resultsCount[0] = No results found # overrides "other"
resultsCount[1] = Found 1 result
# Arabic
resultsCount = ...
resultsCount[0] = ...
resultsCount[1] = ...
resultsCount[2] = ...
resultsCount[few] = ...
resultsCount[many] = ...
resultsCount[10] = ... # overrides "few"
The order in which a @PluralCount of 10 is resolved in Arabic:
1. resultsCount[10]
2. resultsCount[few]
3. resultsCount
Thoughts?
On Sep 9, 7:44 pm, Matt Bishop <[EMAIL PROTECTED]> wrote:
> I spent a couple of fruitless hours yesterday trying to get plurals to
> work the way I wanted them to with the new Plural API. After digging
> through the source code (never a good sign) I discovered that I have
> to accept GWT's notion that '0' is a plural in the English language.
>
> Really? Zero? None?
>
> Technically, yes, none is plural: there is one egg, there are two
> eggs, there are no eggs. However, I wanted this kind of messaging:
>
> Found 1 result.
> Found 23 results.
> No results found.
>
> With the Plural API, I found myself writing my own PluralRule so I
> could trigger the magical DefaultRule_0_1_n class myself. This is not
> to mention that it never worked--GWT would not pick up that rule no
> matter what DefaultLocale I picked.
>
> So this morning over my cappuccino I came to the conclusion that GWT
> is mistakenly joined two concerns that should not be joined, namely
> Plurals and L10N. Instead of being fused together, it makes more sense
> for Plurals to use the resource bundles, but for the definition of
> what plurals to use for a given string should be controlled by how one
> defines the resource. I'd love this:
>
> public String resultsCount(@PluralText int count);
>
> //in props file:
> resultsCount = Found {0} results
> resultsCount[0] = No results found
> resultsCount[1] = Found 1 result
>
> And then; in the same files:
>
> public String shots(@PluralText int count)
>
> shots = {0}-shot espresso
> shots[0] = Steamed milk?
> shots[1] = Single espresso
> shots[2] = Double espresso
> shots[3] = Triple espresso
> shots[4] = Quad me baby!
>
> You see, I have different ideas in different contexts as to what the
> plurals should be.
>
> I may or may not have these same ideas given a different language, but
> that that property file can be different. That's a separate concern
> and should be dealt with separately.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---