The solution provided by Anwesha will work but you will have to manually make sublime text your default opening application for all file formats.
What worked for me in 17.10 was the following:
First what you need is the path to the executable file for sublime text
I have ST 3 and it was at
/opt/sublime_text/sublime_text
Then open your terminal and use the following commands:
sudo update-alternatives --install /usr/bin/gnome-text-editor gnome-text-editor /path/to/executablesublime 100
Then enter:
sudo update-alternatives --config gnome-text-editor
This will bring up a list of the available alternatives, where the default is marked by an asterisk. If sublime text is not it, then select it now by entering corresponding number. Make sure sublime-text's priority is the highest.
And you're done! Hope this helps :D
Here's one way using translate-shell
which is in the Bionic multiverse repository. The homepage is here.
You may need to have gawk
, curl
, and xsel
on your system.
There are a lot of details on the homepage and probably a more efficient way to do things, but this is what I got:
#!/usr/bin/env bash
# source: https://github.com/soimort/translate-shell
# sudo apt install translate-shell
# also needs curl, xsel, and gawk
# sample: https://pl.lipsum.com/
trans -brief "$(xsel -o)" > temp.txt
echo -n "$(cat temp.txt)" | xsel -b -i
In Kubuntu 18.04, I called this script trans.sh
, saved it to ~/bin
, made it executable, and bound it to Meta+U using the Shortcuts
> Custom Shortcuts
in System Settings
.
On a page such as https://pl.lipsum.com/, I highlight some text, move to the location in the destination text editor (including Kate), press Meta+U, wait a couple of seconds, and then press Ctrl+V. The translated text is pasted in at the cursor position.
Source:
What is Lorem Ipsum?
Lorem Ipsum is a text used as an example filler in the printing industry. It was first used in the 15th century by an unknown printer to fill in a text of a test book. Five centuries later, the electronics industry began to be used, remaining virtually unchanged. Popularized in the 1960s with the publication of Letrasetu sheets, containing fragments of Lorem Ipsum, and recently with the different versions of Lorem Ipsum containing software designed to implement prints on personal computers, such as Aldus PageMaker
Note: in the example script, I've used "
but you may prefer using '
unless '
occurs internally as mentioned in the home page:
To avoid punctuation marks (e.g. "!") or other special characters being interpreted by the shell, use single quotes:
...
There are some cases though, you may still want to use double quotes: (e.g. the sentence contains a single quotation mark "'")
Best Answer
This is affecting 18.04 as well. The only remotely related bug (and really old one) I have found is Files & Folders - Favorites opens FTP in browser instead of Nautilus . But this proposed solution doesn't help.