Reputation: 73
I am currently using Google Translate Script Code to convert the text into different languages in my website. However the languages dropdown has many options, I would like to have only 3 Languages ( Kannada, Hindi, English )
Here is the script which i am using
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
Can anyone please tell me how do i have only Kannda,English and Hindi as Language Options
Upvotes: 7
Views: 14824
Reputation: 256
you need to add includedLanguages in the script like this :
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en' , includedLanguages : 'ar,xx,yy'}, 'google_translate_element');
}
Upvotes: 22