trans
Command-line language translator
TLDR
Translate text to your default language
SYNOPSIS
trans [options] [source]:[target] [text ...]
DESCRIPTION
Translate Shell (trans) is a command-line translator powered by Google Translate (default), Bing Translator, Yandex.Translate, and Apertium. It provides quick access to translation services from the terminal.
Language codes follow ISO 639 standards (e.g., en, fr, de, zh-CN, ja). The source language is auto-detected if not specified. Multiple target languages can be specified by joining codes with +.
Interactive mode (-shell) allows translating line by line. Audio playback requires mplayer, mpv, or mpg123. The tool can also function as a dictionary with the -d flag.
PARAMETERS
-b, -brief
Brief mode; show only the translation.-d, -dictionary
Show dictionary definition of the word.-id, -identify
Identify the language of the text.-p, -play
Listen to translation via text-to-speech.-speak
Listen to the original text.-s, -source lang
Specify source language.-t, -target lang
Specify target language.-i, -input file
Read text from a file.-o, -output file
Write translation to a file.-shell, -interactive
Start an interactive translation shell.-e, -engine engine
Use a specific translation engine (google, bing, yandex, apertium).-T, -reference
Print reference table of all supported languages.-V, -version
Print version and exit.-H, -help
Print help message and exit.
CAVEATS
Requires internet connection and depends on external translation services. Heavy usage may trigger rate limiting. Audio playback requires a compatible audio player (mplayer, mpv, or mpg123) to be installed.
HISTORY
Translate Shell was originally named "Google Translate CLI" and was created by Mort Yao (soimort). It was first released around 2012 to provide command-line access to Google Translate. The project was later renamed and expanded to support multiple translation engines including Bing, Yandex, and Apertium.
