Cara Membuat Translate Web Menggunakan HTML dan JavaScript

Sering kali anda mencari tutorial mengenai bagaimana membuat traslate pada suatu website yang anda buat mengalami kesulitan dalam membuatnya. Bagi anda yang suka coding website silahkan perhatikan tutorial berikut:

Buat File index.html / index.php dan masukan script berikut :

<!DOCTYPE html>
<html>
<head>
<title>Cara Membuat Translate Pada Web - Denny ID</title>
</head>
<style type="text/css">
#goog-gt-tt {
display:none !important;
}
.goog-te-banner-frame {
display:none !important;
}
.goog-te-menu-value:hover {
text-decoration:none !important;
}
body {
top:0 !important;
}
#google_translate_element2 {
display:none!important;
}
.lg{
width: 125px;
height: 25px;
margin-top: 5px;
}
</style>
<body>
<br>
<select onchange="doGTranslate(this);" class="lg">
        <option>Select Language</option>           
<option value="id|en" ></i> English</option>
        <option value="id|id" >Indonesia</option>
    </select>

    <div id="google_translate_element2"></div>
   
    <br>
    <br>

    <h2>Cara Membuat Translate Website</h2>
    <p>
    Tutorial lengkap yang mengulas seputar coding serta tempat download source code program web dan desktop gratis.
    Tutorial lengkap yang mengulas seputar coding serta tempat download source code program web dan desktop gratis.
    Tutorial lengkap yang mengulas seputar coding serta tempat download source code program web dan desktop gratis.
    Tutorial lengkap yang mengulas seputar coding serta tempat download source code program web dan desktop gratis.
    Tutorial lengkap yang mengulas seputar coding serta tempat download source code program web dan desktop gratis.
    Tutorial lengkap yang mengulas seputar coding serta tempat download source code program web dan desktop gratis.
    Tutorial lengkap yang mengulas seputar coding serta tempat download source code program web dan desktop gratis.
    </p>

    <!-- javascript -->
<script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit2"></script>
<script type="text/javascript">
function googleTranslateElementInit2() {
new google.translate.TranslateElement(
{
pageLanguage: 'id',
autoDisplay: false
},

'google_translate_element2');
}

function GTranslateFireEvent(element,event){
try{
if(document.createEventObject){
var evt=document.createEventObject();
element.fireEvent('on'+event,evt)
}
else{
var evt=document.createEvent('HTMLEvents');
evt.initEvent(event,true,true);
element.dispatchEvent(evt)
}
}
catch(e){}
}

function doGTranslate(lang_pair){
if(lang_pair.value)lang_pair=lang_pair.value;
if(lang_pair=='')return;
var lang=lang_pair.split('|')[1];
var teCombo;
var sel=document.getElementsByTagName('select');
for(var i=0;i<sel.length;i++)
if(sel[i].className=='goog-te-combo')teCombo=sel[i];
if(document.getElementById('google_translate_element2')==null||document.getElementById('google_translate_element2').innerHTML.length==0||teCombo.length==0||teCombo.innerHTML.length==0)
{
setTimeout(function(){doGTranslate(lang_pair)},500)
}
else{
teCombo.value=lang;GTranslateFireEvent(teCombo,'change');
GTranslateFireEvent(teCombo,'change')
}
}
</script>
</body>
</html> 

Jika sidah selesai silahkan simpan dan lihat hasilnya.
Semoga bermanfaat.



Keywords:

Cara Membuat Translate Web Menggunakan HTML dan JavaScript
Cara Membuat Translate Web dengan  JavaScript
Cara Membuat Translate Web dengan PHP
Cara Membuat Translate Web dengan HTML
Cara Membuat Translate Web dengan select option
Cara Membuat Translate Multi Bahasa
Tutorial Translate Halaman Website
Translate Web With PHP
Membuat Translate Web dengan JavaScript dan PHP

4 Responses to "Cara Membuat Translate Web Menggunakan HTML dan JavaScript"

  1. nice info gan,,,!!!!
    kunjung balik

    https://belajardulinanblog.blogspot.co.id/2017/04/contoh-membuat-input-tanggal-dengan.html

    BalasHapus
  2. https://okermnh.blogspot.co.id/

    BalasHapus
  3. Do you realize there's a 12 word phrase you can say to your crush... that will induce intense feelings of love and instinctual attraction to you deep within his heart?

    Because deep inside these 12 words is a "secret signal" that fuels a man's impulse to love, admire and look after you with his entire heart...

    ===> 12 Words That Fuel A Man's Love Response

    This impulse is so built-in to a man's genetics that it will make him try harder than before to build your relationship stronger.

    Matter-of-fact, fueling this powerful impulse is so binding to having the best ever relationship with your man that the second you send your man one of these "Secret Signals"...

    ...You'll instantly notice him open his soul and heart for you in such a way he's never experienced before and he'll perceive you as the one and only woman in the universe who has ever truly understood him.

    BalasHapus

Visitor