The Idea

After working with the english Language often I needed a fast way for translating words found in texts, homepages, mails or whatever.

This depends on: klipper, dcop (so kde), a shell script, a browser ...

This little guide will tell you how you can translate words in the clip board. First you have to doubleclick a word or simply mark it with the mouse as if you would like to copy'n'paste with X (not CTRL+C as usually done in the M$ environment). Next you trigger a script which finds out what the last element added to the clipboard is and a browser is started queueing for the wanted word.

first step - the script

The script which calls the page. Not really? Yes to be particular it calls the page - it contains less adds.

a=`dcop klipper klipper getClipboardContents`
b=`echo $a | tr -cd "[:alpha:]"`
konqueror  "$b"

chmod 0755 .dict_leo_script

desktop integration

open the "control center" -> "Regional & Accessibility" -> KHotKeys -> New Action

1. next give the new action a name "dict lookup"

2. in the next tab "triggers" create a new shortcut trigger, for example "CTRL+~" as i use it. I had no collusions yet.

3. in the "actions" tab add "command/url" and select the script in /home/joachim/ it's called ".dict_leo_script" the dot at the beginning is there to hide it in the konqueror

4. we're done, click apply and close the dialog

using it

mark a word or doubleclick* it

  • might not an option on link labels on a homepage

afterwards press "CTRL+~" to invoke the translation

Powered by MediaWiki