如何告诉Google翻译不翻译网站的某个部分? [英] How can I tell Google Translate to not translate a section of a website?

查看:484
本文介绍了如何告诉Google翻译不翻译网站的某个部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google翻译有一个开发者工具,可以在网站上进行谷歌翻译。有没有办法告诉谷歌翻译不翻译网站的一部分?也许在HTML元素上有类名?



我试过了 HTML5 translate = no 属性。它没有任何效果。



这是一个特殊的问题,因为Google错误地翻译了网站的名称。

解决方案

根据 Google说明,设置 class =notranslate可以防止Google翻译。这似乎工作,虽然使用它内联(例如,一个单词)可能意味着一些混淆,所以你需要检查发生了什么。

例如, / p>

 欢迎来到< span class =notranslate>酷< / span>公司网站! 

翻译成西班牙语为Bienvenido a la Coolweb de lacompañía!,这不是很酷,但它表明酷已被视为一个专有名称;如果没有标记,文本将翻译为Bienvenido a la fresca web de la empresa!。

将文字重新表达为

 欢迎来到< span class =notranslate>酷< / span>的网站

会导致Bienvenido a lapáginaweb de Cool!,除了site 已被错误翻译。



对于不同的目标语言,可能会出现不同的问题。一般而言,句子的语法结构越简单,翻译得越好。



底线是:您可以尝试阻止翻译 class = notranslate ,但Google翻译的问题可能会导致混淆。


Google Translate has a developer tool that will enable google translate on a website. Is there a way to tell Google Translate to not translate a section of the website? Perhaps with a class name on an HTML element?

I've tried the HTML5 translate=no attribute. It has no effect.

This is a particular problem because Google is mistranslating the name of the website.

解决方案

According to Google instructions, setting class="notranslate" prevents Google translation. This appears to work, though using it inline (e.g., for a single word) may imply some confusion, so you need to check out what happens.

For example,

Welcome to the <span class="notranslate">Cool</span> company website!

translates into Spanish as "Bienvenido a la Coolweb de la compañía!", which isn’t that cool, though it demonstrates that "Cool" has been taken as a proper name; without the markup, the text would translate as "Bienvenido a la fresca web de la empresa!".

Reformulating the text as

Welcome to the website of <span class="notranslate">Cool</span>!

would result in "Bienvenido a la página web de Cool!", which looks better except that "site" has been mistranslated.

For different target languages, different problems may and will arise. In general, the simpler the grammatical structure of a sentence is, the more often it will get translated reasonably well.

The bottom line is: you can try to prevent translation using class=notranslate, but the problems of Google Translator may cause confusion.

这篇关于如何告诉Google翻译不翻译网站的某个部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆