@Enum类型的Select条件在@AlternateMessage注释中不起作用



在模块中继承com.google.gwt.i18n.i18n。

创建一个简单的消息界面:

public interface Languages extends Messages {
    enum Gender {
        MALE, FEMALE;
    }
    @AlternateMessage({ 
        "MALE", "{0} gave you his credits.", 
        "FEMALE", "{0} gave you her credits." 
    })
    @DefaultMessage("{0} gave you their credits.")
    String gaveCredits(String name, @Select Gender gender);
}

将系统添加到ModuleLoad:上的入口点

Languages lang = GWT.create(Languages.class);
System.out.println(lang.gaveCredits("Helmut", Gender.MALE));

实际结果:

"Helmut gave you their credits."

预期结果:

"Helmut gave you his credits."

我做错什么了吗?为什么这不起作用?

我认为它应该有效,但不幸的是,有一个错误(上周修复),当方法中还有@PluralCount时,它只会处理@Select:http://code.google.com/p/google-web-toolkit/source/detail?r=10226

相关内容

  • 没有找到相关文章

最新更新