If you want to make your website multilingual, and you don’t want to waste your time doing the same manually, then the best way to do this is implement Google Translator.
Google Translate allows you to instantly translate your website into 50+ languages. Just follow the below steps and your website is ready to translate the content.
Copy the below required script :
1 2 3 4 5 |
<script type="text/javascript"> function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element'); } </script> |
You can set the default language by replacing “en” to any other language. Use country code to set the default language.
Below code is the html code, put this code where you want the translator option in your website.
1 2 |
<div id="google_translate_element"></div> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> |
That’s it. Good luck and keep sharing.