Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Translate Discrepancy with QtWebEngine #7284

Closed
eclipsed-ninja opened this issue Jun 24, 2022 · 9 comments
Closed

Google Translate Discrepancy with QtWebEngine #7284

eclipsed-ninja opened this issue Jun 24, 2022 · 9 comments

Comments

@eclipsed-ninja
Copy link

eclipsed-ninja commented Jun 24, 2022

Translation in Firefox

firefox

Translation in Qutebrowser

qutebrowser
Version info:

qutebrowser v2.5.2
Git commit: 52d98ad on master (2022-06-22 16:02:57 +0200)
Backend: QtWebEngine 5.15.2, based on Chromium 83.0.4103.122
Qt: 5.15.2

Does the bug happen if you start with --temp-basedir?:

Description
Google translation seems to be providing different translation for QtWebEngine, I've attached two images highlighting the difference.

I'm working on a project of my own and the discussions on #5182 were very helpful in fixing the google login issue. So far I have tried

  • Changing User Agents (Firefox latest, firefox v90, No Agents, IE, Edge, Chrome)
  • Added Accept-Language Header (en-US,en;q=0.5)
  • Logging into the google account (doesn't seem to change anything), played around with empty profiles, lived-in profiles (did a lot of searches etc, so the browser history / cache / cookie collection is good)

But the translation difference remains the same, I thought it would be good idea to ask the dev community here as you've pretty much paved the way for any Qt - browser project.

Also please let me know if there is any License restriction if I use the information / code shared here on my own project along with doing a similar PR for Qutebrowser.

How to reproduce

Translate the following text and you should be able to see the difference

그러나 SPC 측정 체계와 DBL 측정 체계는 모두 기업이 만들이낸 ‘과거’ 사회적 가치를 ‘사후 측정’하는 만큼 기업이 ‘미래’에 만들이낼 수 있는 사회적 가치를 ‘사전 추정’하는 것은 어려웠습니다
@rien333
Copy link
Contributor

rien333 commented Jun 24, 2022

What are the two browsers in your screenshots?

@eclipsed-ninja
Copy link
Author

@rien333 Ah sorry I missed it, I've just edited the issue.

@rien333
Copy link
Contributor

rien333 commented Jun 24, 2022

Can't reproduce, my translation in qutebrowser is the same as your firefox example (are you sure that you didn't accidentally put the wrong header above your examples?) .

content.headers.accept_language equals 'nl-NL, nl;q=0.9, en;q=0.8', and my user agent is Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/6.3.1 Chrome/94.0.4606.126 Safari/537.36

@eclipsed-ninja
Copy link
Author

I checked and titles on the images are correct, this is weird. My app (Qt6-QML) and qutebrowser show the same translation which is different from what's shown on firefox or chrome.

I just tried your language header and user agent strings but didn't work for me. Clueless as to what might be the issue here.

@toofar
Copy link
Member

toofar commented Jun 24, 2022

I see the same difference, how bizarre:
Chromium 101.0.4951.64: "However, as both the SPC measurement system ..."
Qutebrowser Backend: QtWebEngine 6.3, based on Chromium 94.0.4606.126: "However, it was difficult for companies ..."

@rien333
Copy link
Contributor

rien333 commented Jun 25, 2022

Okay, actually I can reproduce both translations in qutebrowser, based on what translate website I visit (QtWebEngine 6.3.1, based on Chromium 94.0.4606.12). Maybe google is just being weird?

This is the search results main page (i.e. google.com):
2022-06-25-1656141371

This is translate.google.nl:
2022-06-25-1656141524

@leo848
Copy link

leo848 commented Jun 25, 2022

Google's code is proprietary, so why is this an issue with qutebrowser?
I don't see that they guarantee the same translations based on one input anywhere so it could be based on anything (including the user agent, random cookies, the availability of browser APIs, your window size, the time, how many people visit their sites etc.), just any arbitrary data.

If the issue is that the translation in qutebrowser is worse for your specific purpose, you should probably use another translation engine. There are several available, I would personally recommend DeepL. It's unfortunately not FOSS either, but at least it doesn't give me different results in different browsers / on different devices.

@RudraveerMandal
Copy link

Yes its never fixed. Google translate is notorious for being shit when used to translate from/to non-european languages. I dont even get the same translation a second later

@The-Compiler
Copy link
Member

While this is indeed very curious (and I can reproduce), this is indeed not something qutebrowser can or should "fix". We have no idea what makes Google Translate behave that way, and it seems futile to try and find out.

@The-Compiler The-Compiler closed this as not planned Won't fix, can't repro, duplicate, stale Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants