I am also, not finding a way to set the locale in GWT. The only way I found is to use a query parameter that will re-load the page. However, although the url locale is changed,the actual page doesn't change the language.
Does anyone know why does this happen?
The code for changing the url:
public static void changeLocale(String localeParamName, String newLocale) {
UrlBuilder newUrl = Window.Location.createUrlBuilder();
newUrl.setParameter(localeParamName, newLocale);
Window.Location.assign(newUrl.buildString());
}
On Wednesday, October 22, 2008 9:36:55 AM UTC+2, Lothar Kimmeringer wrote:
Eduardo Cardoso schrieb:
> WITHOUT refreshing a page and no use of ?locale=en_US after url?At the moment, when using Messages or Constants you can't do that
because the different languages are realized with different HTML-
pages that must be loaded when changing the locale.> something like : setLocale(new Locale.BR) and the page refresh all text
> data.I'm thinking about this as well for a while because there are
projects where the change of the Locale during runtime is a
explicit requirement ruling out GWT at the moment.You can solve that using GWT by not using the Constants/Messages-
framework but with the Dictionary-classes but that eliminates
the advantages you have with the interfaces allowing you to do
the compiler the job of checking the correct spelling of the keys.
Regards, Lothar
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/5GLUOiaGyPoJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment