Skip to content

Instantly share code, notes, and snippets.

@Mauryashubham
Last active Aug 26, 2019
Embed
What would you like to do?
How to change language in google translate using php
How to change language in google translate using php
How to change language in google translate using php
/**
@author : Shubham Maurya,
Email id : maurya.shubham5@gmail.com
**/
Hi all , Welcome to shubhammaurya.com , Today we are going to discuss ,
How to change language in google translate using php
LETS START
Auto Popup on page load
So, To start first make a file in notepad and save it as index.html and paste the below code.
<!-- Google Converter Code Starts -->
<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en' , includedLanguages: 'en,hi'}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<!-- Google Converter Code End -->
You can add more languages using this function
includedLanguages: ' de,nl,en,es,it,fr'
Comment Below, If any problem occurs.
STAY CONNECTED FOR MORE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment