我刚为一家法国餐厅做了一个网站。该网站是英文的,但我猜网站上有足够的法语(标签菜单项的图片),提示访问者翻译网站如果使用Chrome。
有没有什么我可以添加到html,以防止chrome从要求翻译页面?我假设它会是类似于<html lang="en">,但这行不通。
什么好主意吗?
谢谢
我刚为一家法国餐厅做了一个网站。该网站是英文的,但我猜网站上有足够的法语(标签菜单项的图片),提示访问者翻译网站如果使用Chrome。
有没有什么我可以添加到html,以防止chrome从要求翻译页面?我假设它会是类似于<html lang="en">,但这行不通。
什么好主意吗?
谢谢
当前回答
我的Windows是德语。
我在Chrome上做了以下的体验: 如果我设置
<html lang="en" translate="no">
谷歌翻译提出建议翻译英语。
显然我要省略lang性质。这对我来说很管用:
<html translate="no">
没有弹出窗口,URL字段中的翻译图标不再显示。
其他回答
对于最终的解;
<!DOCTYPE html>
<html lang="en" class="notranslate" translate="no">
<head>
<meta name="google" content="notranslate" />
</head>
<body>
...
</body>
</html>
这对我很管用。
有时候你需要阻止的不是所有的html,而是特定的元素,在这种情况下,你可以添加class="notranslate"只对该元素。 ie。<div class="notranslate"> some content </div>
在你的网站上禁用谷歌翻译
将此添加到<head></head>:
<meta name="google" content="notranslate" />
用于不翻译页面的谷歌标记已更新为
<!-- opt out of translation features on all search engines that support this directive -->
<meta name="robots" content="notranslate">
or
<!-- opt out of translation features on Google -->
<meta name="googlebot" content="notranslate">```
欲了解更多信息,请查看此链接:
https://developers.google.com/search/docs/crawling-indexing/special-tags
https://developers.google.com/search/docs/appearance/translated-results
此外,我不得不更新这个,因为它不能在Edge浏览器上运行,只使用translate="no",如下所示:
<html translate="no">
因此,对于一个完整的解决方案,这里也提到了,我必须做这样的事情,不从搜索引擎翻译任何东西
<html lang="en" class="notranslate" translate="no">
<meta name="robots" content="notranslate" />
...
</head>
我的Windows是德语。
我在Chrome上做了以下的体验: 如果我设置
<html lang="en" translate="no">
谷歌翻译提出建议翻译英语。
显然我要省略lang性质。这对我来说很管用:
<html translate="no">
没有弹出窗口,URL字段中的翻译图标不再显示。