How to add a Google Translate button on your HTML5 web page.

Learn how to add google translate to any website or web page.

Example:

<!DOCTYPE html>
<html lang="en-US">
<body>

<h1>My Web Page</h1>

<p>Hello everybody!</p>

<p>Translate this page:</p>

<div id="google_translate_element"></div>

<script type="text/javascript">
function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
</script>

<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

</body>
</html>

Also Read:

One Response

Leave a Reply

Your email address will not be published. Required fields are marked *

Share this article:

RSS2k
Follow by Email0
Facebook780
Twitter3k
120
29k
130k