Red Hat Bugzilla – Bug 1257618
"Console Client Resources" page always use the browser language
Last modified: 2016-04-19 21:31:00 EDT
If you go to the very first page of the RHEV web UI (https://rhevm36.example.com), you have a 'Console Client Resources' under a 'Downloads' headers. When I click on this link, I get a webpage in French (default language I set for my browser) regardless of the language setting I picked on the RHEV home page. This page should follow the RHEV language setting rather than use the browser default language.
@Alexander - this would require having this page go through our locale filter (or similar) that we have, I believe? is that possible?
Looking at the console client resources web.xml it makes reference to the locale filter. So one of two things is happening.
1. Because the console client resources is in its own ear file it doesn't have access to the correct class and thus isn't applying the filter. At which point I guess maybe jboss is setting the global locale to the browser Accept header value.
2. It does have access to the filter, but it can't read the cookie with the locale in it. One of the fallback mechanisms in the filter is to use the locale the browser passes to it. The order goes like this:
a. Use the locale parameter.
b. If no parameter, use the locale cookie.
c. If no cookie, use the Accept header from the browser.
d. If no header, default to US English.
The most likely thing we are seeing is option 2.c where the cookie cannot be read and it falls back to the browser accept header.
The cause of the issue was two fold:
1. The web.xml didn't have the correct filter statements to invoke the LocaleFilter (which reads the cookie).
2. The resource page didn't have the statement to read the locale once it was available. The associated patch fixes both.
Verified - Version: 18.104.22.168-0.1.el6