Hello Thomas, I have just tested in eclipse. I started my webapp & just let 
the server run. When I clicked the button 1st time it used this text "User
455 pls views order". 

Now I just let the server to continue to run without stopping it. Then, I 
changed "User" to "Customer" & then I clicked the button again. This time, 
it showed  "Customer455 pls views order".

I don't understand what u mean?

On Friday, March 7, 2014 8:30:50 PM UTC+11, Thomas Broyer wrote:
>
>
>
> On Friday, March 7, 2014 9:33:26 AM UTC+1, Tom wrote:
>>
>> Messages & Constants (com.google.gwt.i18n.client.Constants & 
>> com.google.gwt.i18n.client.Messages) in GWT allow us to put all Messages 
>> & Constants into properties files so that we can change these messages & 
>> constants at any time we want without the need to recompile the whole 
>> webapp when we need to change them.
>>
> Wrong assumption. You'll have to recompile your app whenever you change 
> anything related to client-side code.
>  
>
>> Ex: you have a message call "User451 pls views order" in 
>> myMessages.properties
>>
>> userViewOrder=User''{0}'' pls views order
>>
>> & in the MyMessages.java
>>
>> public interface MyMessages extends Messages{
>>     String userViewOrder(String userID);}
>>
>> At a later time, the bos wants to change the message to "Customer451 pls 
>> views order" then we don't need to recompile the whole project but just 
>> need to modify the myMessages.properties file
>>
>> userViewOrder=Customer''{0}'' pls views order
>>
>> So my question is, can we achieve the similar thing at the server level?
>>
>> For example, in server, after inserting order data successfully into DB 
>> we need to send a private message to the customer immediately right at the 
>> server. Ex:
>>
>> public boolean isertOrder(String data, String userID){
>>     String sql="insert query here";
>>     ..... more code ....
>>     int resultCode=prepareStmt.executeUpdate();
>>     if (resultCode==1){
>>        //insert a notification into Message table 
>>        String msg="Congratulation user "+userID+", You ordered 
>> successfully!"; // how to manage this message without needing to recompiling 
>> the whole project
>>
>>        String sql="insert into Message values (.....)"
>>        ///do the inserting here
>>     }}
>>
>> can we manage Messages & Constants (i18n) at Server as we manage at 
>> Client?
>>
> You have to know the locale you want to load, and then: 
> http://docs.oracle.com/javase/7/docs/api/java/util/ResourceBundle.html#getBundle(java.lang.String,
>  
> java.util.Locale)
> Note that you'll have to make sure that your *.properties files are 
> US-ASCII, as GWT expects them in UTF-8 and ResourceBundle as ISO-8859-1. 
> You can use a custom ResourceBundle.Control to load them as UTF-8.
> And then use 
> MessageFormat<http://docs.oracle.com/javase/7/docs/api/java/text/MessageFormat.html>for
>  replacing placeholders (for the case of c.g.g.i18n.client.Messages).
>
> That said, there also are existing GWT-like solutions, such as 
> https://github.com/dbaeli/ez18n (see 
> http://fr.slideshare.net/gdigugli/con11234-baeli-diguglielmo)
> There are also a few projects that directly try to use your GWT interfaces 
> on server-side; and it's also a planned feature of GWT proper (no ETA yet).
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to