我在我的网页上使用谷歌翻译。但有些人的姓名无法完全翻译。所以,我想使用以下功能来显示英文和泰米尔语的名称..我想在点击语言按钮的谷歌元素时获得名称更改。请帮帮我。
<!DOCTYPE html>
<html lang="ta">
<head>
<title>Language Translation</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
/*google translation will show select box and show original
button and translate buttons those all are google elements
i mean*/
$(googleElements).on('click', function(){
var txt = $("#TamilEng").text();
if(txt=="தமிழ்"){
$("#Tamil").show();
$("#Eng").hide();
return false;
}
if(txt=="Tamil"){
$("#Tamil").hide();
$("#Eng").show();
return false;
}
});
});
</script>
</head>
<body>
<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'ta', includedLanguages: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, autoDisplay: false, multilanguagePage: true}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<div id="TamilEng">தமிழ்</div>
<input id="Tamil" type="text" value="நன்றி">
<input id="Eng" type="text" value="Welcome" style="display:none;">
</body>
</html>