MediaWiki:Translator/Translator.js

$(function{  document.getElementById('WikiaPageHeader').innerHTML += 'Translate ';    }); document.getElementById("TranslateButton").addEventListener("click", function{  var translatorWindow = window.open;   var url = "http://translate.google.com/#" + wgPageContentLanguage + "/" + mw.config.get("wgUserLanguage") + "/" ;      $( ".RelatedForumDiscussion" ).remove;      $( "noscript" ).remove;       var text = document.getElementById("mw-content-text").textContent ;      function removechar(workingchar,workingstring){         while(workingstring.indexOf(workingchar)!=-1){            workingstring= workingstring.replace(workingchar,"_");         }         return workingstring;      }      text = removechar(' ',text);      text = removechar('<',text);      text = removechar('>',text);      text = removechar('/',text);      text = removechar('\\',text);      text = removechar('\'',text);      text = removechar('\"',text);      text = removechar('=',text);      text = removechar('?',text); text = removechar(',',text); while(text.indexOf("#")!=-1){ text = text.replace("#","_number_"); }     while(text.indexOf("_")!=-1){ text = text.replace("_","%"+"20"); }     url+= text; });