GWT i18n using browser locale
I was trying to get GWT to load a localised permutation based on the user's browser locale. For whatever reason I didn't have much luck coming up with a good combination of search keywords to get a good hit from Google.
After rummaging around in the bowels of GWT I found that it is possible to use the browser locale to determine the build permutation to use.
It doesn't seem all that well publicised or documented (does not figure in the i18n docs for example), although it is used in the showcase demo app.
There are clues as to why it isn't well publicised in the bug containing the original patch.
To use the browser's locale to determine the permutation, simply add the following to the module.gwt.xml:
<set-configuration-property name="locale.useragent" value="Y"/>
Setting the locale of chrome for testing is explained for windows, linux, and mac.
blog comments powered by Disqus