found solution that is to use MyConstants
in client,
public interface MyConstants extends ConstantsWithLookup{ String id(); }
MyConstants_de.properties
id=2121
MyConstants.properties
id=4545
In server
MyConstants myConstants = Hermes.get(MyConstants.class, ""); myConstants.id(); //will print id=4545 MyConstants myConstants = Hermes.get(MyConstants.class, "de"); myConstants.id(); //will print id=2121
On Wednesday, August 6, 2014 12:35:52 PM UTC+10, Tom wrote:
--Ok, I am building GWT app and I am using Hermes to manage the
constants
at Server side.Here is what I did:
I created
MyConstantsWithLookup.
(default English version) &properties MyConstantsWithLookup_de.
(German version) &properties MyConstantsWithLookup.java
in client package-MyConstantsWithLookup.
properties has id=1245
-MyConstantsWithLookup_de.
properties has id=4556
-MyConstantsWithLookup.javapublic interface MyConstantsWithLookup extends ConstantsWithLookup { int id(); }
There is
Data.java
in Server package.Data.java
haspublic static int id(){ try { MyConstantsWithLookup myConstantsWithLookup = Hermes.get(
MyConstantsWithLookup.class, ""); return myConstantsWithLookup.id(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return ""; } Ok, it works fine if i open the page in English. Ex,
myDomain.com
it will show correctly theid=1245
. However, if i open the page in German languagemyDomain.com?locale=de
then it did not pick up theid=4556
but still use the old id.Did i do anything wrong here?
How to fix it?
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" 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 http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment