Jump to content
K.Ermit

Is there a way I can use Google Translate on Frog?

Recommended Posts

I have managed to get Google Translate working with the HTML widget, if anyone would like to try it out and report back:

<script>
var google_translate_element,
    googleTranslate = document.createElement('script');
google_translate_element = $("<div>", { id: Frog.Utilities.generateSimpleId() });

window.setTimeout(function() {
    new google.translate.TranslateElement({pageLanguage: 'en'}, google_translate_element.attr('id'));
}, 5000);

googleTranslate.src = "//translate.google.com/translate_a/element.js";
document.head.appendChild(googleTranslate);
arguments[0].append(google_translate_element);
google_translate_element.addClass('translateBar');
</script>

<style>
    .translateBar {
        position: absolute;
        top: 0px;
        right: 0px;
    }

</style>

 

Google seems keen to encourage users to run Google Translate directly in the Chrome browser, using the Google Translate extension:

https://chrome.google.com/webstore/detail/google-translate/aapbdbdomjkkjkaonfhkkikfgjllcleb

You can share this link with parents, and all they need to do is click the button marked Add to Chrome.  The extension will appear in their browser's toolbar and translate most text on all websites into their chosen language.

 

Link to post
Share on other sites

Works for me!!

16 hours ago, Graham Quince said:

I have managed to get Google Translate working with the HTML widget, if anyone would like to try it out and report back:


<script>
var google_translate_element,
    googleTranslate = document.createElement('script');
google_translate_element = $("<div>", { id: Frog.Utilities.generateSimpleId() });

window.setTimeout(function() {
    new google.translate.TranslateElement({pageLanguage: 'en'}, google_translate_element.attr('id'));
}, 5000);

googleTranslate.src = "//translate.google.com/translate_a/element.js";
document.head.appendChild(googleTranslate);
arguments[0].append(google_translate_element);
google_translate_element.addClass('translateBar');
</script>

<style>
    .translateBar {
        position: absolute;
        top: 0px;
        right: 0px;
    }

</style>

I still think the Chrome extension is a better way to do this, but if parents are not using Chrome, then at least this method should (in theory) be able to run Google Translate on any browser

Works for me!! Tried it in Chrome and Safari!!  👍

  • Thanks 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...