+ 4
Why is this code using the Google Translator not working?
Can anyone please point out the error? https://code.sololearn.com/WK7Msok3x21l/?ref=app
4 ответов
+ 5
Yep, Calvin. It seems that only works on PC, I just tried it from my phone and I get an error because it can not use cookies correctly.
+ 4
The code is working correctly for me. Although I would order the scripts in a different way:
<script src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
</script>
+ 2
You need to add
<div id="google_translate_element"></div>
for google translate to form the translated page.
And I think this only works on PC, not on phone webview.
+ 1
Mickel does this one too work for you.
I only see the text with no optn. to translate it.
https://code.sololearn.com/WkmaW6sykBAR/?ref=app