Thursday, June 21, 2012

Invoking specific locale in gwt application



To invoke a specific locale from a gwt application using the URL,

add the get parameter locale=<string> where
string is the locale defined in your module file.  

for example:
Make sure your gwt module xml file contains the language you are trying to set.


<?xml version="1.0" encoding="UTF-8"?>
<module>
    <inherits name="com.google.gwt.user.User" />
    <inherits name="org.broadleafcommerce.openadmin.userModule" />
    <inherits name="com.google.gwt.core.CompilerParameters"/>
    <inherits name="com.google.gwt.i18n.I18N"/>
    <extend-property name="locale" values="en_US"/>
    <extend-property name="locale" values="es"/>
    <extend-property name="locale" values="es_MX"/>
    <extend-property name="locale" values="fr"/>
    <set-property-fallback name="locale" value="en_US"/>
<entry-point class="org.broadleafcommerce.openadmin.client.BLCLaunch" />
</module>