Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/* Translating a webpage to english using google translate. */
CmdUtils.CreateCommand({
names: ["GTranslate"],
icon: "http://www.google.com/images/icons/illustrations/translate_search-lb80.png",
arguments: [{role: "object", nountype: noun_arb_text, label: "URL to translate"}],
description: "Translating a webpage to english using google translate.",
help: "<i>Select the url and press enter</i>.",
author: {name: "DexterGk", email: "dextergk@gmail.com"},
license: "GPL",
homepage: "http://dextergk.blogspot.com/",
preview: function preview(pblock,args) {
pblock.innerHTML = this.help;
},
execute: function(args) {
Utils.openUrlInBrowser("http://translate.google.com/translate?js=n&prev=_t&hl=en&ie=UTF-8&layout=2&eotf=1&sl=auto&tl=en&u="+args.object.text);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.