GNOME Bugzilla – Bug 758716
Accept-Language header not being set since the WebKit2 port
Last modified: 2017-08-08 11:06:34 UTC
Created attachment 316336 [details] Screenshot with a wrong language When attempting to login to Google account with Gnome Online Accounts, after I login I get a window (attached screenshot) with Hebrew text (supposedly because I am located in Israel). I am unable to read it. Please make this window to show the Google's page in my desktop language (English for me). gnome-online-accounts 3.18.2.1-1 for Debian Linux "stretch".
Until more than a year ago we used to set SoupSession:accept-language-auto to TRUE. Then when we ported to WebKit2 we stopped doing that because it was no longer possible to get access to the SoupSession used by the WebKitWebView. This is what the Git history has to say: [rishi@kolache gnome-online-accounts]$ git log -S accept-language-auto src/ commit 81434a02fe638d982afdbe6cd9e5b75ddfdf238f Author: Damián Nohales <damiannohales@gmail.com> Date: Fri Jan 9 15:41:54 2015 -0300 Port to WebKit 2 Bump minimum WebKitGTK+ version to 2.7.2 because we need to create our own WebKitWebContext and handle user script messages. https://bugzilla.gnome.org/show_bug.cgi?id=742680 commit e4ad74ed571948cff98d3f5d3b355e5148cf903e Author: Debarshi Ray <debarshir@gnome.org> Date: Mon May 14 18:24:50 2012 +0200 webview: Set the SoupSession's "accept-language-auto" to TRUE This is useful because Facebook sends the OAuth2 log in page in the wrong language unless the Accept-Language header is set. libsoup uses g_get_language_names() [1] if SoupSession:accept-language-auto is TRUE, and that should do what you want. Question is, how do we set it? Neither epiphany nor webkitgtk+ has any hits for "git log -S accept-language-auto" or "git grep accept-language-auto". [1] https://developer.gnome.org/glib/unstable/glib-I18N.html#g-get-language-names
(In reply to Debarshi Ray from comment #1) > Question is, how do we set it? This should work: http://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebContext.html#webkit-web-context-set-preferred-languages
Created attachment 357181 [details] [review] webview: Address the loss of SoupSession:accept-language-auto=TRUE I am sorry that this was left unfixed for so long.
Google has changed their UI since this bug was filed. Now it seems to always be in English regardless of location or whether Accept-Language is set or not. It might be using the language specified in the user's Google preferences. However, I could reproduce the problem with Facebook, and this patch fixes it.
Comment on attachment 357181 [details] [review] webview: Address the loss of SoupSession:accept-language-auto=TRUE Pushed to master, gnome-3-24 and gnome-3-22.