Related styles:
-
Created: Jun 02, 2011Last Updated: Apr 28, 2013
-
Created: Apr 18, 2015Last Updated: Apr 22, 2015
-
Created: Jan 25, 2016Last Updated: Feb 22, 2017
-
Created: Dec 06, 2012Last Updated: Sep 08, 2015
-
Created: Sep 03, 2016Last Updated: Feb 21, 2017
-
Created: Jan 29, 2015Last Updated: Feb 24, 2016
-
Created: Jul 25, 2014Last Updated: Mar 08, 2017
-
Created: Feb 18, 2014Last Updated: Jan 28, 2016
-
Created: Feb 22, 2012Last Updated: Feb 09, 2015
banthaz@userstyles deleted this style
Try Add-ons Manager - In the Sidebar - Companion instead of this deleted style.
See more styles for Google
Google Translate - In the Sidebar
Description:
More info
How to use Google Translate from the sidebar:
Alternative 1: Via a bookmark, set to open in the sidebar.
Alternative 2: Via some extension that can execute JavaScript code (like “keyconfig”, “Custom Buttons” and “FireGestures”) with the following code:
var sidebar = document.getElementById("sidebar");
var sidebarBox = document.getElementById("sidebar-box");
var sidebarSplitter = document.getElementById("sidebar-splitter");
var text = document.commandDispatcher.focusedWindow.getSelection().toString();
var url = "http://translate.google.se/?text="+text;
if(sidebar.contentDocument.location != "about:blank" &&
document.getElementById("sidebar-title").value == "Google Translate" &&
(!text || sidebar.contentDocument.getElementById("web-panels-browser").getAttribute("cachedurl") == url)) {
if(sidebarBox.hidden) {
document.getElementById("viewWebPanelsSidebar").setAttribute("checked","true");
sidebarBox.setAttribute("sidebarcommand", "viewWebPanelsSidebar");
sidebarBox.hidden = sidebarSplitter.hidden = false;
} else {
document.getElementById("viewWebPanelsSidebar").removeAttribute("checked");
sidebarBox.removeAttribute("sidebarcommand");
sidebarBox.hidden = sidebarSplitter.hidden = true;
content.focus();
}
} else {
openWebPanel("Google Translate", url);
sidebarBox.width = 250;
}
In the next to last line you can specify the width of sidebar when Google Translate is opened.
The script works like this:
If you have selected some text when invoking the script, Google Translate will be opened in the Sidebar, if not open already, and the selected text will transferred to the translation box. Otherwise, or if the selected text already had been translated, the sidebar will be hidden.
Thanks to dorando, the author of the keyconfig extension, who made the above script.
Jan 27 2013
Improved: The dictionary at the bottom is now vertical instead of horizontal.
Jan 22 2013
Fixed for site changes.
Jun 04 2012
Improved: Now hides more unnecessary things.
Jun 02 2012
First release.
First install FreeStyler to use this style.
If you already installed it, please, make sure this site is allowed to run JavaScript.But you can download Freestyler for other browsers and apply styles there!
Applies to:
all URLs