Print
Category: My linux experience
Hits: 2100
Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

Problem: Need to quickly translate phrase avoiding opening google translate, copy-pasting etc.

I need often to translate a phrase from one language to another. Currently I often need to translate English to German. KDE Klipper is a perfect tool to do it from keyboard quickly, without opening google translate in browser. There is still some delay while requesting a remote server, but it's much quicker the opening a browser tab and doing a number of other copy-paste-click-task-switch tasks.

Translation from to Klipper demo

What we need is: install packages, create a CLI script and tie the script to a Klipper action.

Install packages

sudo zypper in translate-shell xclip

Create a CLI script to translate from one language to another

Create file ~/bin/translate.sh file with contents:

Make sure the script works. Run in terminal: translate.sh en de Some text to be trasnlated

In a couple of seconds you should get a popup message telling the text is translated. The result will be placed to the clipboard.

Add an action to Klipper

Add action to Klipper

How to use

Found a typo? Please select it and press Ctrl + Enter.
FaLang translation system by Faboba