User:UncoveredAgent200/TranslateText.js

var WikiaHeader = document.getElementById('WikiHeader'); var MonobookHeader = document.getElementById('firstHeading');

if (WikiaHeader !== null) { var TranslateDiv = document.createElement('div'); TranslateDiv.id = 'google_translate_element'; WikiaHeader.appendChild(TranslateDiv); }

if (MonobookHeader !== null) { var TranslateDiv = document.createElement('div'); TranslateDiv.id = 'google_translate_element'; MonobookHeader.appendChild(TranslateDiv); }

function googleTranslateElementInit { new google.translate.TranslateElement({pageLanguage: 'en', multilanguagePage: true}, 'google_translate_element'); }

var TranslateScript = document.createElement('script'); TranslateScript.setAttribute('type', 'text/javascript'); TranslateScript.setAttribute('src', '//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit');

document.getElementsByTagName('head')[0].appendChild(TranslateScript);