将以下代码粘贴到您的网站上.包含在googleTranslateElementInit()中的语言中提到的语言将显示在您的网站上.
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.
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages: 'en,fr,es,it,de'}, 'google_translate_element');
}
此外,如果您正在寻找特定语言的自动翻译,请使用此代码以及上述代码.
(function() {
if(!window.location.hash) {
window.location = window.location + '#googtrans(en|fr)';
window.location.reload();
}
})();