Internationalization - how to use the browser language configuration??

14 views
Skip to first unread message

Michel

unread,
Mar 4, 2008, 9:22:30 AM3/4/08
to Google Web Toolkit
Hi everyone. I saw in another post that:

"As I understand it the locale is determined at the application start
up (so called 'Deferred Binding' =>
http://code.google.com/support/bin/answer.py?answer=59657&topic=10211).
That means if you don't specify anything, GWT will try to load the
locale that matches with the users browser language.

I think GWT already does what you want out of the box. Correct me if
am wrong..? "

But that is wrong... we cannot get that out of the box...
GWT doesn't display the page based in the browser setup...
For example, I have 3 property files: default (English), Portuguese
and German.

The application is always displayed in english, no matter what the
browser is setup to display German first...
The only way of doing that would be using metatag or a parameter in
the URL... but I would like to make that display always the language
according to the browser configuration, as we have with Struts/JSF...

Does anyone knows any way of making it work that way?

Best regards,
Michel.

Jason Morris

unread,
Mar 5, 2008, 3:15:09 AM3/5/08
to Google-We...@googlegroups.com
This helper filter should do the trick (although the internationalization code
is currently untested).

We use it to great effect on the compression and header setting side of things,
the internationalization code is there, just untested ;)

Hope this helps.

Regards,
Jason.

GWTHelperFilter.java

Michel

unread,
Mar 5, 2008, 11:33:00 AM3/5/08
to Google Web Toolkit
Thanks Jason!
I'll give it a try.

Best regards,
Michel.
> GWTHelperFilter.java
> 7KDownload
Reply all
Reply to author
Forward
0 new messages