How to Translate words using dict command 

To Translate Words Using Dict Command

Translating words from one language to another can be easily done using the Linux commands. All you need to do for that is to use the dict command in an efficient manner. It is really easy to use it, but make sure you have it installed in your system first. This tutorial covers the ground on installation and usage of the dict command to translate words from one language to another. 

 

Installing DICT

It is important to install the dictd server by making use of the following command.

root@linuxhelp:~# apt-get install dict
Reading package lists... Done
Building dependency tree       
Reading state information... Done
.
.
Setting up recode (3.6-22) ...
Setting up dict (1.12.1+dfsg-3) ...
Setting up m4 (1.4.17-5) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...

 


Once that is over, you need to install the translation database. Here we are installing English to French database. 

root@linuxhelp:~#  apt-get install dict-freedict-eng-fra
Reading package lists... Done
Building dependency tree       
Reading state information... Done
.
.
Unpacking dict-freedict-eng-fra (2014.10.22-2build1) ...
Setting up dict-freedict-eng-fra (2014.10.22-2build1) ...

 

Once the database is installed, you can launch it by making use of the following command. All the available translation databases will be listed as an output.

root@linuxhelp:~# dict &ndash D

Databases available:
 fd-eng-spa English-Spanish FreeDict Dictionary ver. 0.2.1
 fd-eng-fra English-French FreeDict Dictionary ver. 0.1.4 
use a particular datbase  eg., for english to french 

 

 

Now, you can try translating a word from one language to another. Here Goodbye is translated from English to French. 

root@linuxhelp:~# dict -d fd-eng-fra " goodbye"     
3 definitions found

From English-French FreeDict Dictionary ver. 0.1.4 [fd-eng-fra]:

  goodbye‐
   d' adieu

From English-French FreeDict Dictionary ver. 0.1.4 [fd-eng-fra]:

  goodbye /gudbai/
   1. adieu
   2. adieu
   3. au revoir

From English-French FreeDict Dictionary ver. 0.1.4 [fd-eng-fra]:

  good‐bye
   adieu

This is how we can translate words from command line in ubuntu 16.04


 

Comment
kennethewing
May 22 2022
For me, this information is relevant. Thank you. I didn't know about these commands before. Now I will use them and I'm sure it will simplify the work.
Add a comment
FAQ
Q
How to install Cambridge dictionary without wine?
A
All methods will envolve some sort of usage of Windows where virtualization with VMWare or VirtualBox is the best thing to use. Even far superior to WINE.
Q
Which is the best offline dictionary for Ubuntu ?
A
Installation:

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
(to allow Universe repo)

sudo apt-get install dict
sudo apt-get install dictd
Q
Is this command doesn't require any ppa?
A
No it can be installed from default ppa!!
Q
What translation database is used here?
A
Here we have installed english to french translation database
Q
What is the syntax to be used?
A
Say dict -d fd-eng-fra "word to be transalated"