Monday, September 25, 2017

Plurals (using 2 plural forms in one paragraph not working -> bug in GWT compiler?)

Hi.

I have the following definition:


@DefaultMessage("{0,number} preceding items, and {1,number} " +
"followup items.")
@Description("Label showing the number of preceding items and " +
"follow-up items")
@AlternateMessage({
"none|one", "One follow-up item.",
"one|none", "One preceding item.",
"one|one", "One preceding item, and one follow-up item.",
"none|other", "{1,number} follow-up items.",
"other|none", "{0,number} preceding items.",
"one|other", "One preceding item, and {1,number} follow-up" +
" items.",
"other|one", "{0,number} preceding items, and one follow-up " +
"item."
})
String precedingAndFollowupMeetingCount(
@PluralCount(PluralRuleNoneOne.class) int precedingItemsCount,
@PluralCount(PluralRuleNoneOne.class) int followUpItemssCount);


I defined the PluralRuleNonOne.class as follows

import com.google.gwt.i18n.client.impl.plurals.DefaultRule;
import com.google.gwt.i18n.client.impl.plurals.DefaultRule_0_1_n;

public final class PluralRuleNoneOne extends DefaultRule {
@Override
public PluralForm[] pluralForms() {
return DefaultRule_0_1_n.pluralForms();
}

@Override
public int select(final int n) {
return DefaultRule_0_1_n.select(n);
}
}


How the gwt compiler (with -extra) produces (among other things) the following properties file:


# Description: Label showing the number of preceding items and follow-up items
# 0=precedingItemssCount (Plural Count), 1=followUpItemsCount (Plural Count)
# - Default plural form
BE52173166487BB95708A7E45EB0752B={0,number} preceding items, and {1,number} follow-up items.
# - plural form 'none': Count is 0
BE52173166487BB95708A7E45EB0752B[none]=
# - plural form 'one': Count is 1
BE52173166487BB95708A7E45EB0752B[one]=


Now I wonder for what the red highlighted properties stand for. As there are TWO parameters it seems impossible to have a property like [none] or a single [one]?

Is this a bug in the GWT compiler or do I have some misconcept in my Message class?

Thanks for any advice

Hannes

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment