How do I prevent Safari from offering to translate a page?
Asked Answered
I

3

14

I run a website that is in English but iOS 14 mobile Safari still offers to translate the page. How do I prevent this?

From this similar question I've found none of these work:

1. <html lang="en">
2. <html translate="no">
3. <meta name="google" content="notranslate">
4. <meta http-equiv="content-language" content="en" />
Impossibility answered 2/10, 2020 at 0:12 Comment(6)
Did you ever find a solution to this?Zugzwang
@Zugzwang No. Will post if I do.Impossibility
I have it on good authority that macOS 11.3 and iOS 14.5 will support it. Also try current Safari Technology Preview.Pucka
@Pucka I tested iOS and STP and the issue has not been fixed. If you're able to confirm otherwise, please share. If it's a rumor or a guess, please also share that.Impossibility
This is horrible. I can't disable it either, and it is causing scroll issues in our app. If safari detects the page is in a different language our scroll position gets lost on back navigation now. Hopefully they finally fix this..Casablanca
@JonathanBerger Took it from this exchange with a Safari engineer. Will ask them again. twitter.com/xeenon/status/1360314272245420034Pucka
I
0

I submitted this issue to Apple and it was fixed with iOS and macOS releases in December 2021.

A WebKit engineer via Twitter exchange suggested I submit the specific instance of my issue with the URL in question to Apple using Feedback Assistant. I did this and was then asked to test with builds 19D5026g (iOS) and 21D5025f (macOS). These fixed the issue.

Impossibility answered 3/1, 2023 at 13:21 Comment(0)
P
0

Isolate the offending bit(s) that are triggering the translate offer. Start with a skeleton:

<!DOCTYPE html>
<html>
<head><title></title></head>
<body></body>
</html>

Did that trigger a translate offer? If not, great, start adding some of the code from the problem page to your skeleton, reloading as you go, until you find the offending bit(s). Once you find out what's triggering the translate offer, you might be able to modify your code or content so that doesn't happen.

Pampero answered 2/1, 2023 at 9:57 Comment(0)
I
0

I submitted this issue to Apple and it was fixed with iOS and macOS releases in December 2021.

A WebKit engineer via Twitter exchange suggested I submit the specific instance of my issue with the URL in question to Apple using Feedback Assistant. I did this and was then asked to test with builds 19D5026g (iOS) and 21D5025f (macOS). These fixed the issue.

Impossibility answered 3/1, 2023 at 13:21 Comment(0)
E
-5

Solution

You can try html tag like this <html translate="no">.

This will make your html page to non-translate.

Other Versions

<meta name="google" content="notranslate">

<html lang="en" class="notranslate">

<meta http-equiv="content-language" content="en" />

For more: https://www.w3.org/International/questions/qa-http-and-lang

Eckstein answered 2/10, 2020 at 0:38 Comment(1)
Hi, I actually mentioned those ideas in my original question and they didn't work.Impossibility

© 2022 - 2024 — McMap. All rights reserved.