网站上的Google翻译有问题吗? [英] Issue with Google Translation on Website?

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

问题描述

因此,我正在将google翻译工具用于我的网站- 我是通过以下方式进行设置的: https://translate.google.com/manager/website

So I am using the google translate tool for my website- I am setting it up via: https://translate.google.com/manager/website

在显示模式下,我一直选择自动,但看起来横幅总是显示,即使他们声明只有在浏览器不是网站的语言(即EN)时它才会显示

Under display mode, I keep choosing automatic but it looks like the banner ALWAYS displays even though they state it will ONLY show if the browser is not the language of the site (which is EN)

这是怎么回事?他们的工具坏了吗?有没有办法使用此工具来显示语言是否为英文?

What's going on? Is their tool broken? is there a way to use this tool to just show if the language is not en?

推荐答案

将以下代码粘贴到您的网站上. googleTranslateElementInit()中includeLanguage中提到的语言将显示在您的网站上.

Paste the code below on your website. Languages mentioned in includedLanguages in googleTranslateElementInit() will display on your website.

我建议您将此粘贴到网站的页眉或页脚部分,以便在网站的每个页面上都可以使用翻译功能.

I will suggest you to paste this in website header or footer section so that translation feature will yield on every page of your website.

<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages: 'en,fr,es,it,de'}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

此外,如果您要查找特定语言的自动翻译,请在上面使用此代码.

<script>
(function() {
if(!window.location.hash) {
    window.location = window.location + '#googtrans(en|fr)';
    window.location.reload();
} 
})();   
</script>

这篇关于网站上的Google翻译有问题吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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