1TRANS(1)                                                              TRANS(1)
2
3
4

NAME

6       trans  -  Command-line translator using Google Translate, Bing Transla‐
7       tor, Yandex.Translate, etc.
8

SYNOPSIS

10       trans [OPTIONS] [SOURCE]:[TARGETS] [TEXT]...
11

DESCRIPTION

13       This tool translates text into any language from the command-line,  us‐
14       ing  a translation engine such as Google Translate, Bing Translator and
15       Yandex.Translate.
16
17       Each argument which is not a valid option is  treated  as  TEXT  to  be
18       translated.
19
20       If  neither  TEXT nor the input file is specified by command-line argu‐
21       ments, the program will read and translate from standard input.
22

OPTIONS

24   Information options
25       -V, -version
26              Print version and exit.
27
28       -H, -help
29              Print help message and exit.
30
31       -M, -man
32              Show man page and exit.
33
34       -T, -reference
35              Print reference table of all supported languages and codes,  and
36              exit.   Names of languages are displayed in their endonyms (lan‐
37              guage name in the language itself).
38
39       -R, -reference-english
40              Print reference table of all supported languages and codes,  and
41              exit.  Names of languages are displayed in English.
42
43       -S, -list-engines
44              List available translation engines and exit.
45
46       -list-languages
47              List all supported languages (in endonyms) and exit.
48
49       -list-languages-english
50              List all supported languages (in English names) and exit.
51
52       -list-codes
53              List all supported codes and exit.
54
55       -list-all
56              List  all  supported  languages (endonyms and English names) and
57              codes, and exit.
58
59       -L CODES, -linguist CODES
60              Print details of languages and exit.   When  specifying  two  or
61              more language codes, concatenate them by plus sign "+".
62
63       -U, -upgrade
64              Check for upgrade of this program.
65
66   Translator options
67       -e ENGINE, -engine ENGINE
68              Specify the translation engine to use.  (default: auto)
69
70   Display options
71       -verbose
72              Verbose mode.
73
74              Show  the  original text and its most relevant translation, then
75              its phonetic notation (if any), then  its  alternative  transla‐
76              tions  (if  any) or its definition in the dictionary (if it is a
77              word).
78
79              This option is unnecessary in most cases since verbose  mode  is
80              enabled by default.
81
82       -b, -brief
83              Brief mode.
84
85              Show  the most relevant translation or its phonetic notation on‐
86              ly.
87
88       -d, -dictionary
89              Dictionary mode.
90
91              Show the definition of the original word in the dictionary.
92
93       -identify
94              Language identification.
95
96              Show the identified language of the original text.
97
98       -show-original Y/n
99              Show original text or not.  (default: yes)
100
101       -show-original-phonetics Y/n
102              Show phonetic notation of original text or not.  (default: yes)
103
104       -show-translation Y/n
105              Show translation or not.  (default: yes)
106
107       -show-translation-phonetics Y/n
108              Show phonetic notation of translation or not.  (default: yes)
109
110       -show-prompt-message Y/n
111              Show prompt message or not.  (default: yes)
112
113       -show-languages Y/n
114              Show source and target languages or not.  (default: yes)
115
116       -show-original-dictionary y/N
117              Show dictionary entry of original text or not.  (default: no)
118
119              This option is enabled in dictionary mode.
120
121       -show-dictionary Y/n
122              Show dictionary entry of translation or not.  (default: yes)
123
124       -show-alternatives Y/n
125              Show alternative translations or not.  (default: yes)
126
127       -w NUM, -width NUM
128              Specify the screen width for padding.
129
130              This option overrides the setting of environment variable  $COL‐
131              UMNS.
132
133       -indent NUM
134              Specify the size of indent (number of spaces).  (default: 4)
135
136       -theme FILENAME
137              Specify the theme to use.  (default: default)
138
139       -no-theme
140              Do not use any other theme than default.
141
142       -no-ansi
143              Do not use ANSI escape codes.
144
145       -no-autocorrect
146              Do not autocorrect.  (if defaulted by the translation engine)
147
148       -no-bidi
149              Do not convert bidirectional texts.
150
151       -bidi  Always convert bidirectional texts.
152
153       -no-warn
154              Do not write warning messages to stderr.
155
156       -dump  Print raw API response instead.
157
158   Audio options
159       -p, -play
160              Listen to the translation.
161
162              You  must  have  at  least  one  of  the supported audio players
163              (mplayer,  mpv  or  mpg123)  installed  to  stream  from  Google
164              Text-to-Speech  engine.   Otherwise,  a local speech synthesizer
165              may be used instead (say on macOS,  espeak  on  Linux  or  other
166              platforms).
167
168       -speak Listen to the original text.
169
170       -n VOICE, -narrator VOICE
171              Specify the narrator, and listen to the translation.
172
173              Common values for this option are male and female.
174
175       -player PROGRAM
176              Specify the audio player to use, and listen to the translation.
177
178              Option  -play will try to use mplayer, mpv or mpg123 by default,
179              since these players are known to work for streaming  URLs.   Not
180              all  command-line audio players can work this way.  Use this op‐
181              tion only when you have your own preference.
182
183              This option overrides the setting of environment variable $PLAY‐
184              ER.
185
186       -no-play
187              Do not listen to the translation.
188
189       -no-translate
190              Do not translate anything when using -speak.
191
192       -download-audio
193              Download the audio to the current directory.
194
195       -download-audio-as FILENAME
196              Download the audio to the specified file.
197
198   Terminal paging and browsing options
199       -v, -view
200              View the translation in a terminal pager (less, more or most).
201
202       -pager PROGRAM
203              Specify the terminal pager to use, and view the translation.
204
205              This  option  overrides  the  setting  of  environment  variable
206              $PAGER.
207
208       -no-view, -no-pager
209              Do not view the translation in a terminal pager.
210
211       -browser PROGRAM
212              Specify the web browser to use.
213
214              This  option  overrides  the  setting  of  environment  variable
215              $BROWSER.
216
217       -no-browser
218              Do not open the web browser.
219
220   Networking options
221       -x HOST:PORT, -proxy HOST:PORT
222              Use HTTP proxy on given port.
223
224              This  option  overrides  the  setting  of  environment variables
225              $HTTP_PROXY and $http_proxy.
226
227       -u STRING, -user-agent STRING
228              Specify the User-Agent to identify as.
229
230              This option overrides the setting of environment variables  $US‐
231              ER_AGENT.
232
233       -4, -ipv4, -inet4-only
234              Connect only to IPv4 addresses.
235
236       -6, -ipv6, -inet6-only
237              Connect only to IPv6 addresses.
238
239   Interactive shell options
240       -I, -interactive, -shell
241              Start  an  interactive  shell, invoking rlwrap whenever possible
242              (unless -no-rlwrap is specified).
243
244       -E, -emacs
245              Start the GNU Emacs front-end for an interactive shell.
246
247              This option does not need to, and cannot be used along  with  -I
248              or -no-rlwrap.
249
250       -no-rlwrap
251              Do not invoke rlwrap when starting an interactive shell.
252
253              This  option  is useful when your terminal type is not supported
254              by rlwrap (e.g.  emacs).
255
256   I/O options
257       -i FILENAME, -input FILENAME
258              Specify the input file.
259
260              Source text to be translated will be read from the  input  file,
261              instead of standard input.
262
263       -o FILENAME, -output FILENAME
264              Specify the output file.
265
266              Translations  will  be  written  to  the output file, instead of
267              standard output.
268
269   Language preference options
270       -hl CODE, -host CODE
271              Specify your home language (the language you would like  to  see
272              for displaying prompt messages in the translation).
273
274              This  option  affects only the display in verbose mode (anything
275              other than source language and target language will be displayed
276              in  your  home  language).   This  option has no effect in brief
277              mode.
278
279              This option is optional.  When its setting is  omitted,  English
280              will be used.
281
282              This  option  overrides  the  setting  of  environment variables
283              $LC_ALL, $LANG, and $HOST_LANG.
284
285       -s CODES, -sl CODES, -source CODES, -from CODES
286              Specify the source  language(s)  (the  language(s)  of  original
287              text).   When specifying two or more language codes, concatenate
288              them by plus sign "+".
289
290              This option is optional.  When its setting is omitted, the  lan‐
291              guage  of original text will be identified automatically (with a
292              possibility of misidentification).
293
294              This  option  overrides  the  setting  of  environment  variable
295              $SOURCE_LANG.
296
297       -t CODES, -tl CODES, -target CODES, -to CODES
298              Specify  the  target  language(s) (the language(s) of translated
299              text).  When specifying two or more language codes,  concatenate
300              them by plus sign "+".
301
302              This  option  is  optional.  When its setting is omitted, every‐
303              thing will be translated into English.
304
305              This option  overrides  the  setting  of  environment  variables
306              $LC_ALL, $LANG, and $TARGET_LANG.
307
308       [SOURCE]:[TARGETS]
309              A  simpler,  alternative  way to specify the source language and
310              target language(s) is to use a shortcut formatted string:
311
312SOURCE-CODE:TARGET-CODE
313
314SOURCE-CODE:TARGET-CODE1+TARGET-CODE2+...
315
316SOURCE-CODE=TARGET-CODE
317
318SOURCE-CODE=TARGET-CODE1+TARGET-CODE2+...
319
320              Delimiter ":" and "=" can be used interchangeably.
321
322              Either SOURCE or TARGETS may be omitted, but the delimiter char‐
323              acter must be kept.
324
325   Text preprocessing options
326       -j, -join-sentence
327              Treat all arguments as one single sentence.
328
329   Other options
330       -no-init
331              Do not load any initialization script.
332
333       --     End-of-options.
334
335              All arguments after this option are treated as TEXT to be trans‐
336              lated.
337

EXIT STATUS

339       0      Successful translation.
340
341       1      Error.
342

ENVIRONMENT

344       PAGER  Equivalent to option setting -pager.
345
346       BROWSER
347              Equivalent to option setting -browser.
348
349       PLAYER Equivalent to option setting -player.
350
351       HTTP_PROXY
352              Equivalent to option setting -proxy.
353
354       USER_AGENT
355              Equivalent to option setting -user-agent.
356
357       HOST_LANG
358              Equivalent to option setting -host.
359
360       SOURCE_LANG
361              Equivalent to option setting -source.
362
363       TARGET_LANG
364              Equivalent to option setting -target.
365

FILES

367       /etc/translate-shell
368              Initialization script.  (system-wide)
369
370       $HOME/.translate-shell/init.trans
371              Initialization script.  (user-specific)
372
373       $XDG_CONFIG_HOME/translate-shell/init.trans
374              Initialization script.  (user-specific)
375
376       ./.trans
377              Initialization script.  (current directory)
378

FURTHER DOCUMENTATION

380       <https://github.com/soimort/translate-shell/wiki>
381

REPORTING BUGS

383       <https://github.com/soimort/translate-shell/issues>
384

AUTHORS

386       Mort Yao <soi@mort.ninja>.
387
388
389
3900.9.7.1                           2023-02-08                          TRANS(1)
Impressum