Created
April 3, 2011 22:11
-
-
Save dextergk/900875 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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