I am using an enumeration class in my GWT client’s code to define a set of types.
public enum MyType {
FIRST_TYPE("first"), SECOND_TYPE("second"), THIRD_TYPE("third");
private String title;
private MyType(String title) {
this.title = title;
}
public String getTitle() {
return this.title;
}
}
How is it possible to localize the enum values to translate them into different languages? The title field is not that important and could be dropped if this helps to solve the problem.
I know the ResourceBundle approach from Java, but that is not working in GWT’s client code.
I managed to solve the problem by using GWT’s
ConstantsWithLookupinterface.Here is the solution:
MyType.java
MyConstantsWithLookup.java
MyConstantsWithLookup.properties