Created
January 15, 2009 21:50
-
-
Save netsuke/47648 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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