@Select condition with Enum type does not work in @AlternateMessage annotation
Inherit com.google.gwt.i18n.I18N in your module.
Create a simple Messages interface:
public interface Languages extends Messages {
enum Gender {
MALE, FEMALE;
}
@AlternateMessage({
"MALE", "开发者_如何学C{0} gave you his credits.",
"FEMALE", "{0} gave you her credits."
})
@DefaultMessage("{0} gave you their credits.")
String gaveCredits(String name, @Select Gender gender);
}
Add system out to EntryPoint onModuleLoad:
Languages lang = GWT.create(Languages.class);
System.out.println(lang.gaveCredits("Helmut", Gender.MALE));
Actual result:
"Helmut gave you their credits."
Expected result:
"Helmut gave you his credits."
Did I get something wrong? Why wouldn't this work?
I think it should have worked, but unfortunately there was a bug (fixed last week) that would only process @Select
when there's also a @PluralCount
in the method: http://code.google.com/p/google-web-toolkit/source/detail?r=10226
精彩评论