Jump to content

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


K.Ermit

Recommended Posts

  • 2 months later...

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 comment
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 comment
Share on other sites

  • 1 month later...
19 hours ago, Sean_M said:

Do not use this in Edit mode!!! haha. Make sure you have the original language selected before opening the Editor.

It'll save it as the translated language otherwise.

It does - kept catching one of our schools out.  Their spanish teachers were updating the remote learning pages.  Took us awhile to figure out what was going on.

  • Haha 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...