Skip to content

Instantly share code, notes, and snippets.

@Mauryashubham
Last active August 26, 2019 07:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mauryashubham/ac949f9086ba381fdc7f85108466ad77 to your computer and use it in GitHub Desktop.
Save Mauryashubham/ac949f9086ba381fdc7f85108466ad77 to your computer and use it in GitHub Desktop.
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