[英]Google Translator Button Not Appearing At All
我將使我的網站多語言。 作為實現此目的的最簡單方法,我正在嘗試添加一個 Google Translator Widget。 我發現了一些腳本可以放在 HTML 文件中,但這對我不起作用。 是不是我遺漏了什么或者谷歌停用了這個?
這是 HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> Google Translater for Website </title>
</head>
<body>
<h2>Your Web Page</h2>
<p>Click on the dropdown button to translate.</p>
<p>Translate this page:</p>
<div id="google_translate_element"></div>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
</script>
<p>You can translate the content of this page by selecting a language in the select box.</p>
</body>
</html>
這是此文件的 output:
有什么想法嗎? 請分享。 謝謝你。
您的代碼對我來說工作正常,嘗試以隱身模式運行它並嘗試可能某些擴展阻止它顯示
Google 已停止使用 Google 翻譯小部件。 它可能適用於某些網站(已使用多年),但不適用於以前沒有的新安裝/網站。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.