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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
<!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
1 2 |
<!-- 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" /> |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<!-- 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> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
<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
1 Comments