GWT i8n 复数(在一个段落中使用 2 个复数形式不起作用 - GWT 编译器中的>错误?



我在我的消息类中具有以下消息定义:

@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 precedingAndFollowupItemCount(
@PluralCount(PluralRuleNoneOne.class) int precedingItemsCount,
@PluralCount(PluralRuleNoneOne.class) int followUpItemssCount);

我定义了cluralrulenononone.class如下

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);
}

现在,GWT编译器(带有-Extra)生产(除其他)以下属性文件:

# 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]=*

现在,我想知道突出显示的属性的代表。由于有两个参数,似乎不可能拥有诸如BE52173166487BB95708A7E45E45EB0752B [none] =?

之类的属性

此外,替代消息从何而来,例如:

BE52173166487BB95708A7E45EB0752B [无|一个] =一个后续项目。

这是GWT编译器中的错误,还是我的消息类中有一些误解?

感谢您的任何建议。

Hannes

刚刚找到以下文章:https://github.com/gwtproject/gwt/sissues/7032解决问题:

您需要在您的消息类中使用@generate(format =" com.google.gwt.i18n.server.server.propertycatalogfactory")。

最新更新