MediaWiki:Common.js: Porovnání verzí
Z The Last Kingdom UO Wiki
Bez shrnutí editace |
Bez shrnutí editace |
||
| Řádek 1: | Řádek 1: | ||
// Google Translate | // Force Google Translate widget to load on every page | ||
function | (function () { | ||
function addGoogleTranslate() { | |||
if (document.getElementById('google_translate_element')) return; | |||
var div = document.createElement('div'); | var div = document.createElement('div'); | ||
div.id = 'google_translate_element'; | div.id = 'google_translate_element'; | ||
| Řádek 18: | Řádek 11: | ||
div.style.zIndex = '9999'; | div.style.zIndex = '9999'; | ||
document.body.appendChild(div); | document.body.appendChild(div); | ||
var script = document.createElement('script'); | |||
script.src = "https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"; | |||
document.body.appendChild(script); | |||
} | } | ||
window.googleTranslateElementInit = function () { | |||
new google.translate.TranslateElement({ | |||
document. | pageLanguage: 'cs', | ||
}); | includedLanguages: 'cs,en', | ||
autoDisplay: false | |||
}, 'google_translate_element'); | |||
}; | |||
document.addEventListener("DOMContentLoaded", addGoogleTranslate); | |||
})(); | |||