Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save netsuke/47648 to your computer and use it in GitHub Desktop.
Save netsuke/47648 to your computer and use it in GitHub Desktop.
CmdUtils.CreateCommand({
name: "translatepage",
icon: "http://www.google.com/favicon.ico",
author: { name: "Nanya Bizuidenhoud", email: "netsuke87@yahoo.com"},
description: "Automatically translate the current page to english using google translate",
help: "Just type translatepage in the ubiquity interface and push enter to translate",
preview: function( pblock) {
pblock.innerHTML = "Automatically detect the language of the current page and translate it into English";
},
execute: function(keyword) {
var url = context.focusedWindow.document.URL;
var translate="http://translate.google.com/translate?u="+url;
Utils.openUrlInBrowser(translate);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment