userscript for qutebrowser for translation of pages or selected text using Google translate/LibreTranslate. Makes a qute popup!
Copy the file translate to the qutebrowser's userscripts directory (~/.config/qutebrowser/userscripts) and make it executable.
To translate the current page
spawn --userscript translate --url
You can specify target language. For example to translate to Georgian do
spawn --userscript translate --target_lang ka
This translates the selection and calls a small JS snippet to display a popup in bottom right corner. To dismiss the popup click outside of it.
spawn --userscript translate
The userscript can also be used in hint mode by doing
hint links userscript translate
config.bind('tt', 'spawn --userscript translate')You can use nix-shell shebang for python dependency management
#! /usr/bin/env nix-shell
#! nix-shell -i python3 -p python3Packages.requestsCheck out Qute-Translate!
