// Source - https://stackoverflow.com/q/79831318
// Posted by Baangla Deshi, modified by community. See post 'Timeline' for change history
// Retrieved 2025-11-27, License - CC BY-SA 4.0
<div id="google_translate_element"></div>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
// Get a reference to the code element
const codeElement = document.getElementById('myCodeElement');
// Change the translate attribute to "yes"
if (codeElement) {
codeElement.setAttribute('translate', 'yes');
console.log("Translate attribute changed to 'yes'.");
} else {
console.log("Element with ID 'myCodeElement' not found.");
}
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}