tags:

views:

1304

answers:

1

GWT gets locale from either the locale property or the locale query string. If neither is specified, it uses the "default" (ie en_US) locale.

Why doesn't it get it from the browser settings?

It seems the only solution to this is to replace your static html launch page with soemthing like a JSP that reads the browser locales and sets the locale or redirects using the query string. There has to be a better solution than this or simply hard-coding a locale, surely?

+1  A: 

If you put a list of available languages into your *.gwt.xml file it will by default switch to the first language listed.

<!-- Slovenian in Slovenia -->
<extend-property name="locale" values="sl"/>

<!-- English language, independent of country -->
<extend-property name="locale" values="en"/>
Drejc
I had this where I had en_AU added as the only extend-property and it defaulted to "default" still. It took the locale query parameter or <meta> tag to actually get it to en_AU. I can't imagine just "en" would be any different but, even if it were, that wouldn't help. I don't want en_US.
cletus