Google Translate is a multilingual neural machine translation tool developed by Google that allows users to translate text, documents, and webpages between languages. It has a website interface, an Android and iOS mobile app, and an API that developers can use to create browser extensions and software apps.
The pros of Google Translate:
- It’s free
- It’s fast
- It’s convenient
Add Google Translate to your website
Add this code to the website <head>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
You need to add a element where the script can load the translate dropdown. So, add a <div> with id google_translate_element
<div id="google_translate_element"></div>
Finally, Add a JavaScript function to enable & execute the Translate load events
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element')
}
You can view the live preview here.
Read our other blogs
- 7 Improvements to make mobile friendly website
- Mastering HTML Semantic Structure for Improved User Experience
- Create Section Divider using CSS
Thank you for reading the article. 😊