Search code examples
javagwtlocale

How to change locale by GWT without javascript


Currently I change my locale in GWT using a javascript as a native code. if the user click on changeLocale button on my GUI, i call this native method.

Is there any java method/way to do that without using any native code???


Solution

  • Have you looked at the Showcase sample?

    Redux'd, it's as easy as:

    Window.Location.assign( // or replace()
       Window.Location.createUrlBuilder()
          .setParameter(LocaleInfo.getLocaleQueryParam(), "fr-FR")
          .buildString());