To achieve a multi-language website, I have attached the below code in the HTML.
reference: https://www.w3schools.com/howto/howto_google_translate.asp
<div id="google_translate_element"></div>
<script>
function googleTranslateElementInit() {
new google.translate.TranslateElement(
{pageLanguage: 'en'},
'google_translate_element'
);
}
</script>
<script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script
But translation does not work with dynamic rendering content. if I refresh the page then it will work.
anyone could help? how can I achieve translation without refreshing the page?