After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 758716 - Accept-Language header not being set since the WebKit2 port
Accept-Language header not being set since the WebKit2 port
Status: RESOLVED FIXED
Product: gnome-online-accounts
Classification: Core
Component: general
3.18.x
Other All
: Normal normal
: ---
Assigned To: GNOME Online Accounts maintainer(s)
GNOME Online Accounts maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-11-26 18:18 UTC by Victor Porton
Modified: 2017-08-08 11:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot with a wrong language (35.84 KB, image/png)
2015-11-26 18:18 UTC, Victor Porton
  Details
webview: Address the loss of SoupSession:accept-language-auto=TRUE (1.60 KB, patch)
2017-08-08 10:50 UTC, Debarshi Ray
committed Details | Review

Description Victor Porton 2015-11-26 18:18:13 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".
Comment 1 Debarshi Ray 2016-03-24 14:24:36 UTC
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
Comment 2 Michael Catanzaro 2016-03-24 16:46:17 UTC
(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
Comment 3 Debarshi Ray 2017-08-08 10:50:53 UTC
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.
Comment 4 Debarshi Ray 2017-08-08 10:57:05 UTC
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 5 Debarshi Ray 2017-08-08 10:57:29 UTC
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.