Bug 752215 - at runtime, automatically detect what GWT locale to use as the default, based on the user's browser preferences
at runtime, automatically detect what GWT locale to use as the default, based...
Status: ON_DEV
Product: RHQ Project
Classification: Other
Component: Core UI (Show other bugs)
Unspecified Unspecified
medium Severity medium (vote)
: ---
: ---
Assigned To: Mike Thompson
Mike Foley
: Improvement
: 701878 (view as bug list)
Depends On:
Blocks: rhq-uxd
  Show dependency treegraph
Reported: 2011-11-08 15:52 EST by Ian Springer
Modified: 2015-02-01 18:29 EST (History)
4 users (show)

See Also:
Fixed In Version: 4.3.0
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ian Springer 2011-11-08 15:52:06 EST
See http://learngwt.com/articles/mdamour1976/AutomaticGWTInternationalizationdetection.html for some good ideas on how to do 
Comment 1 Heiko W. Rupp 2011-11-08 16:07:50 EST
Can  vote for this? :-)
Comment 2 Ian Springer 2011-11-08 17:51:59 EST
In GWT 2.3, there is a new feature that allows you to configure a module to default to the browser locale, by adding the following line to the module.gwt.xml file:

<set-configuration-property name="locale.useragent" value="Y"/>

However, according to http://stackoverflow.com/questions/156412/why-does-gwt-ignore-browser-locale, this feature does not work in IE...
Comment 3 John Mazzitelli 2012-02-10 16:07:02 EST
> <set-configuration-property name="locale.useragent" value="Y"/>

I can't get this to work with either FF or Chrome. I must be missing something or this isn't the only thing you need to do.
Comment 4 John Mazzitelli 2012-02-13 14:03:43 EST
*** Bug 701878 has been marked as a duplicate of this bug. ***
Comment 5 Mike Thompson 2012-02-13 14:10:26 EST
By Adding two lines to the GWT configuration

<set-configuration-property name="locale.usemeta" value="N"/>
 <set-configuration-property name="locale.searchorder" value="queryparam,useragent,cookie"/>

The first line is just for good measure in case someone every puts a language meta tag in the page then we will ignore that use the query param followed by the browser agent instead.

I configured my browser for german and tested against  FF and chrome but not on IE yet.
Comment 6 Mike Thompson 2012-02-13 14:31:07 EST
Committed to the branch: feature/gwt-upgrade
Commit: http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commitdiff;h=70f4a60a2aaabbdbad567794df8de6ab016c773b
Comment 7 Mike Thompson 2012-02-17 11:15:09 EST
Need to add the server-side piece of this to work properly for all browsers.
Comment 8 Mike Thompson 2012-05-24 10:50:03 EDT
Just need to update the status here to be more explicit where this is and what's left to do.

Core Problem: IE populates the 'Accept-Language' with 'en-US' which is a totally different format than firefox or chrome which use the format: 	en,de;q=0.8,ja;q=0.7,pt;q=0.5,en-us;q=0.3,en-gb;q=0.2' So different parsing is required for different browsers, but because this is a header only server side resources can parse the header.

The current situation is browser settings for languages work with browsers other than IE. For IE to work properly I need to get at the browser headers (which can't be done in gwt) but instead, though some server side technology such as seam or jsp that allows us to get at the request headers ('Accept-Language'). Currently, the gwt app page that servers up coregui is an html page (no server side). This html page would need to change to a jsp or xhtml(seam) page and some logic to get the language based on the browser applied.

Note You need to log in before you can comment on or make changes to this bug.