Web Tools Table Maker3schools TranslateImage CompressorFavicon Icon GeneratorCrop & Resize Image
Apu
Apu January 23, 2023 › #Google #GoogleTranslate

Display only 3 languages in google translate HTML

In the previous article I discussed how to add google translate button on your website and how to remove copyright from google translate button also.

In this article, I'll be able to guide you on how to show only three languages on the google translate button.

Google offers many languages but we can select according to our needs using the includedLanguages:'' .

Example #

Click on the Try It Yourself » button to open the code in our online editor.

<div id='google_translate_element'></div>
<script>

 function googleTranslateElementInit() {

 new google.translate.TranslateElement({

 pageLanguage: 'en',

 autoDisplay: 'true',

 includedLanguages:'hi,en,bn,id,fr', 

 layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL

 }, 'google_translate_element');

 }

 </script>
Try it Yourself »
In the example above, you can see the marked code, you just need to change its value with your language code.
save
listen
AI Answer
Write Your Answer
loading
back
View All