How to Create Multi-lingual Website in HTML: In this paragraph, we discuss how to create multi-lingual or multi language website in html or another language. Firstly we discuss what is multi-lingual website and how can we use in simple js and css for it. How to Create Multi-lingual Website in HTML, How to Build Multi-lingual Website, Create Multi-lingual Website in HTML, Design Multi-language website using html, CSS and JS, How to create google translator design for website.
What is Multi-lingual Website
A multilingual web site is any web site that gives content material in a couple of language. For instance, a Canadian enterprise with English and French variations of its web site. A multi-regional web site is one which explicitly targets customers in numerous international locations. How to Create Multi-lingual Website in HTML
In Simple way a multilingual website is a website that has content is more than one language.
What is the use of Multi-lingual Website
-
Reaching a larger Viewers
- By offering a number of language choices you’ll be opening up your corporation proposition to new buyer segments that had been beforehand out of attain, this in flip will enable you enhance your gross sales and income.
- Decreasing Bounce and Bettering Conversion Charges
- The reduction in bounce rate you’ll experience as a result of going multilingual will have an inverse effect on your conversion rate – which will improve thanks to consumers feeling confident that they fully understand all the steps in the purchasing process.
How to Create Multi-lingual Website in HTML
Follow the steps Carefully:
- Create any Page in html or php.
- Go to google translator api and use in these page
- Style CSS according to your Website
- In these Post i’ll show you the flag without country name.
Build Multi-lingual Website in HTML – How can I make my site multilingual
Follow those steps for Create Multi-lingual Website in HTML:
- Firstly Go to your htdocs folder and create a new folder multi-language.
- Now Create a html page and Paste following Code
<!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> ` <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script> <!-- Flag CSS --> <link href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/css/flag-icon.min.css" rel="stylesheet" type="text/css" /> <!-- Style Select Box--> <style> .selectpicker { border:none; color:#000; background:none; } option { background-color: #fff !important; } .btn-default.active.focus, .btn-default.active:focus, .btn-default.active:hover, .btn-default:active.focus, .btn-default:active:focus, .btn-default:active:hover, .open>.dropdown-toggle.btn-default.focus, .open>.dropdown-toggle.btn-default:focus, .open>.dropdown-toggle.btn-default:hover { color:transparent; background-color: transparent; border-color:transparent; } .bootstrap-select.btn-group:not(.input-group-btn), .bootstrap-select.btn-group[class*=span], .bootstrap-select.btn-group[class*=col-] { margin-bottom:3px; } .goog-te-banner-frame.skiptranslate, .skiptranslate { display: none !important; } .selectpicker, .bootstrap-select { padding:1px; } .bootstrap-select>.btn { width: 100%; padding-right: 0; background:transparent; border:none; } .bootstrap-select>.btn:hover { background:transparent; border:none; } .bootstrap-select.btn-group .dropdown-menu { border:none; box-shadow:none; } .open>.dropdown-menu { display:block!important; overflow: visible!important; min-height: 7px!important; } .goog-logo-link, .glyphicon { display:none !important; } .btn-default.active, .btn-default:active, .open>.dropdown-toggle.btn-default { background-color:transparent; border-color:transparent; box-shadow:none; } .dropdown-menu { font-size:20px; background-color:transparent; border:none!important; } .dropdown-menu>li>a { padding:2px; border:none!important; } .dropdown-menu>li>a:hover, .selected { background-color: transparent!important; border:none!important; } .trans-section .btn { border:none; } .btn-group.open .dropdown-toggle { box-shadow:none; } .flag-icon { line-height: 24px; width: 24px; background-size:cover; } </style> <!-- End Style Select Box--> </head> <body> <!-- Html Tag --> <div class="trans-section" style="float:right;"> <div id="google_translate_element" style=""></div> <select class="selectpicker" data-width="fit" onchange="translateLanguage(this.value);"> <option data-content='<span class="flag-icon flag-icon-us"></span>' value="English">EN</option> <option data-content='<span class="flag-icon flag-icon-ar"></span>' value="Arabic">AR</option> <option data-content='<span class="flag-icon flag-icon-cn"></span>' value="Chinese">CN</option> <option data-content='<span class="flag-icon flag-icon-fr"></span>' value="French">FR</option> <option data-content='<span class="flag-icon flag-icon-pt"></span>' value="Portuguese (Portugal, Brazil)">PT</option> <option data-content='<span class="flag-icon flag-icon-ru"></span>' value="Russian">RU</option> <option data-content='<span class="flag-icon flag-icon-es"></span>' value="Spanish">ES</option> </select> </div> <!-- End Html Tag --> <!-- Website Main Body --> <div class="jumbotron text-center"> <h1>My First Bootstrap Page</h1> <p>Resize this responsive page to see the effect!</p> </div> <div class="container"> <div class="row"> <div class="col-sm-4"> <h3>Column 1</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p> <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p> </div> <div class="col-sm-4"> <h3>Column 2</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p> <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p> </div> <div class="col-sm-4"> <h3>Column 3</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p> <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p> </div> </div> </div> <!-- End Website Content --> <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script> <!-- Translate JS --> <script src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit" type="text/javascript"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js" type="text/javascript"></script> <!-- Select Box JS --> <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.6.2/js/bootstrap-select.min.js" type="text/javascript"></script> <!-- Main Script for TranslateElement --> <script type="text/javascript"> function googleTranslateElementInit() { new google.translate.TranslateElement({ pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, autoDisplay: false }, 'google_translate_element'); } function translateLanguage(lang) { googleTranslateElementInit(); var $frame = $('.goog-te-menu-frame:first'); if (!$frame.size()) { alert("Error: Could not find Google translate frame."); return false; } $frame.contents().find('.goog-te-menu2-item span.text:contains(' + lang + ')').get(0).click(); return false; } $(function() { $('.selectpicker').selectpicker(); }); </script> </body> </html>
- Now Check Your Page its look like:
Note: If you want change style according to your website so change in style in head section. Also Make sure your design not disturbed.
How to Create Multi-lingual Website in HTML Main CSS or JS
<!-- Flag CSS --> <link href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/css/flag-icon.min.css" rel="stylesheet" type="text/css" />
<!-- Html Tag for Translation --> <div class="trans-section" style="float:right;"> <div id="google_translate_element" style=""></div> <select class="selectpicker" data-width="fit" onchange="translateLanguage(this.value);"> <option data-content='<span class="flag-icon flag-icon-us"></span>' value="English">EN</option> <option data-content='<span class="flag-icon flag-icon-ar"></span>' value="Arabic">AR</option> <option data-content='<span class="flag-icon flag-icon-cn"></span>' value="Chinese">CN</option> <option data-content='<span class="flag-icon flag-icon-fr"></span>' value="French">FR</option> <option data-content='<span class="flag-icon flag-icon-pt"></span>' value="Portuguese (Portugal, Brazil)">PT</option> <option data-content='<span class="flag-icon flag-icon-ru"></span>' value="Russian">RU</option> <option data-content='<span class="flag-icon flag-icon-es"></span>' value="Spanish">ES</option> </select> </div>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script> <!-- Translate JS --> <script src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit" type="text/javascript"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js" type="text/javascript"></script> <!-- Select Box JS --> <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.6.2/js/bootstrap-select.min.js" type="text/javascript"></script> <!-- Main Script for TranslateElement --> <script type="text/javascript"> function googleTranslateElementInit() { new google.translate.TranslateElement({ pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, autoDisplay: false }, 'google_translate_element'); } function translateLanguage(lang) { googleTranslateElementInit(); var $frame = $('.goog-te-menu-frame:first'); if (!$frame.size()) { alert("Error: Could not find Google translate frame."); return false; } $frame.contents().find('.goog-te-menu2-item span.text:contains(' + lang + ')').get(0).click(); return false; } $(function() { $('.selectpicker').selectpicker(); }); </script>
Any doubts on the topic? Please mention them in the Comments section below and I’d be glad to help you out.
Also Read: How to Send mail using localhost with php
One thought on “How to create Multi-lingual Website in HTML | Create Multilingual Website in HTML”