-
Notifications
You must be signed in to change notification settings - Fork 393
REPL
Welcome to the Interactive Translate Shell! Here you can translate any text into any language interactively.
This short tutorial will walk you through the basic usage of the REPL.
Start an interactive session:
$ trans -shell
Now let's do some translation: (suppose your locale
is English and you are trying to translate an Italian word "mondo")
> mondo
mondo
world
Definitions of mondo
[ Italiano -> English ]
noun
world
mondo, terra
earth
terra, mondo, massa, terreno, suolo, globo
universe
universo, mondo
society
società, mondo, associazione, compagnia, circolo
a world of
mondo
adjective
cleaned
mondo
If the above translation is not enough for you, you may :set
the value of show-original-dictionary
to 1
so that the dictionary entry of the original Italian word is shown as well:
> :set show-original-dictionary 1
> mondo
Or, to the contrary, if the above translation is too verbose for you, you can just turn off the verbose mode: (i.e. turn on the brief mode)
> :set verbose 0
> mondo
Bring the verbose mode back:
> :set verbose 1
To find out what the actual value of a specific setting is, use the :show
command:
> :show verbose
If you are an Italian speaker looking at the English definition of the word "mondo", un sostantivo may be more likable than a noun. So why not just set your home language to Italian? (unless your locale
is already Italian, of course)
> :set hl it
> mondo
It's even easier to set the source language and the target language(s): (same old syntax)
> it:fr
Italiano>
Notice that the prompt changed itself to "Italiano>
", which means that the source language has been set to Italian explicitly. Your input will now be translated into French, as specified by the previous command:
Italiano> mondo
monde
Let's change the target language once more: (Japanese, this time)
Italiano> :ja
Italiano> mondo
世界
A shorter way of doing this:
Italiano> :de mondo
Welt
Lastly, the :quit
(:q
) command is for you to quit the REPL elegantly.