-
Notifications
You must be signed in to change notification settings - Fork 503
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
Chrome's translate feature cannot reliably translate JavaScript reference page #5379
Comments
FWIW Translation via https://translate.google.com/ works: https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript?_x_tr_sl=en&_x_tr_tl=de&_x_tr_hl=en&_x_tr_pto=wapp When I try to translate with Chrome, I'm getting the following error in the JavaScript console:
Background: https://rapidsec.com/csp-packages/google_translate So it looks like to support Google Translate via Chrome, we will have to adjust our Content-Security-Policy here: Lines 71 to 144 in 2d7a154
|
Here's a screenshot of the network requests triggered by translating http://example.com/ with Chrome's translate feature: So I believe we need to
And I will see if I can create a PR shortly. |
CSP was not the cause, because other articles translated without any issues. Here are two observations I made:
This all sounds more like a Chrome bug than a MDN bug, and in fact there is a very recent issue in Chrome's bug tracker: https://bugs.chromium.org/p/chromium/issues/detail?id=1304514 |
It indeed works just fine on https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach for example. I was also able to translate the above page from English to Arabic |
@Hill-98 Can you perhaps update your version of Chrome to 99 and see if the problem persists? I tested with Version 99.0.4844.51 |
The problem is still there, but I found the element causing the problem. Likewise, the translation feature does not work at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/constructor. I think it has something to do with |
@Hill-98 Would you mind filing an issue for this in the Chromium issue tracker? That would be great! |
I have not used Chromium issue tracker and my English is not very good. If you'd like to submit this issue in the Chromium issue tracker, that's certainly fine. |
Summary
Chrome's translation feature doesn't work on the redesigned MDN's JavaScript reference page, and when I try to translate an English page to another language, the text always reverts to English in a flash.
Where did you spot the bug?
https://developer.mozilla.org/en-US/docs/Web/JavaScript
What is the problem?
Chrome translation does not work on JavaScript reference pages
What did you expect to happen?
Chrome translation works properly on JavaScript reference pages
Steps to reproduce the issue
Environment
Device
Browser
Operating system
Screenshots
The text was updated successfully, but these errors were encountered: