How To Add Google Translate Button On Your Webpage?
Google Translate is a free multilingual machine translation service developed by Google, to translate text from one language into another. It offers a website interface, mobile apps for Android and iOS, and an API that helps developers build browser extensions and software applications. Google Translate supports over 100 languages at various levels.
Follow the steps to add a google translate button on your website:
Step 1: Start with a basic web page and add a div element.
In the code below a div element with the id google_translate_element is created.
Step 2: Add google translate api reference.
Step 3: Add Javascript function..
Example:
Output:
Output after translating into Arabic: