Aliases make sense as locale-specific concepts. If a properties-file
writer (not the same person as the developer in almost every
professional case) wants to utilize them, they should be able to just
call them out.
resultsCount[few] = A few results
However, I think this use case is a bit edgy. For simplicity, the
default behavior would be to just do the number-based system:
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!
If someone wanted to use aliases, they could call them out in the
property file:
myMsgs_ar.prop:
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!
shots[few] = Turkish coffee
shots[many] = Way too strong for anyone
If I passed in 3, or 4, I would get the [3] and [4] specific message.
If I passed in 5, I would get Turkish coffee. If I passed in 100, I
would get the 'many' message.
So Aliases would be defined by the locale and used after the specific
callouts were examined. You don't get to define new aliases are
redefine an alias without writing a new DefaultRule.
Finally, I would deprecate @DefaultMessage and
@PluralText. .properties files have been around a long time and have
proven effective. We want to keep those UI strings out of the .java
files and in the hands of trained linguists and grammarians.