.\" Automatically generated by Pandoc 2.5 .\" .TH "TRANS" "1" "2019\-07\-25" "0.9.6.11" "" .hy .SH NAME .PP trans \- Command\-line translator using Google Translate, Bing Translator, Yandex.Translate, etc. .SH SYNOPSIS .PP \f[B]trans\f[R] [\f[I]OPTIONS\f[R]] [\f[I]SOURCE\f[R]]:[\f[I]TARGETS\f[R]] [\f[I]TEXT\f[R]]... .SH DESCRIPTION .PP This tool translates text into any language from the command\-line, using a translation engine such as Google Translate, Bing Translator and Yandex.Translate. .PP Each argument which is not a valid option is treated as \f[I]TEXT\f[R] to be translated. .PP If neither \f[I]TEXT\f[R] nor the input file is specified by command\-line arguments, the program will read and translate from standard input. .SH OPTIONS .SS Information options .TP .B \f[B]\-V\f[R], \f[B]\-version\f[R] Print version and exit. .TP .B \f[B]\-H\f[R], \f[B]\-help\f[R] Print help message and exit. \f[B]\-M\f[R], \f[B]\-man\f[R] Show man page and exit. .TP .B \f[B]\-T\f[R], \f[B]\-reference\f[R] Print reference table of all supported languages and codes, and exit. Names of languages are displayed in their endonyms (language name in the language itself). .TP .B \f[B]\-R\f[R], \f[B]\-reference\-english\f[R] Print reference table of all supported languages and codes, and exit. Names of languages are displayed in English. .TP .B \f[B]\-L\f[R] \f[I]CODES\f[R], \f[B]\-list\f[R] \f[I]CODES\f[R] Print details of languages and exit. When specifying two or more language codes, concatenate them by plus sign \[dq]+\[dq]. .TP .B \f[B]\-S\f[R], \f[B]\-list\-engines\f[R] List available translation engines and exit. .TP .B \f[B]\-U\f[R], \f[B]\-upgrade\f[R] Check for upgrade of this program. .SS Translator options .TP .B \f[B]\-e\f[R] \f[I]ENGINE\f[R], \f[B]\-engine\f[R] \f[I]ENGINE\f[R] Specify the translation engine to use. (default: google) .SS Display options .TP .B \f[B]\-verbose\f[R] Verbose mode. .RS .PP Show the original text and its most relevant translation, then its phonetic notation (if any), then its alternative translations (if any) or its definition in the dictionary (if it is a word). .PP This option is unnecessary in most cases since verbose mode is enabled by default. .RE .TP .B \f[B]\-b\f[R], \f[B]\-brief\f[R] Brief mode. .RS .PP Show the most relevant translation or its phonetic notation only. .RE .TP .B \f[B]\-d\f[R], \f[B]\-dictionary\f[R] Dictionary mode. .RS .PP Show the definition of the original word in the dictionary. .RE .TP .B \f[B]\-identify\f[R] Language identification. .RS .PP Show the identified language of the original text. .RE .TP .B \f[B]\-show\-original\f[R] \f[I]Y/n\f[R] Show original text or not. (default: yes) .TP .B \f[B]\-show\-original\-phonetics\f[R] \f[I]Y/n\f[R] Show phonetic notation of original text or not. (default: yes) .TP .B \f[B]\-show\-translation\f[R] \f[I]Y/n\f[R] Show translation or not. (default: yes) .TP .B \f[B]\-show\-translation\-phonetics\f[R] \f[I]Y/n\f[R] Show phonetic notation of translation or not. (default: yes) .TP .B \f[B]\-show\-prompt\-message\f[R] \f[I]Y/n\f[R] Show prompt message or not. (default: yes) .TP .B \f[B]\-show\-languages\f[R] \f[I]Y/n\f[R] Show source and target languages or not. (default: yes) .TP .B \f[B]\-show\-original\-dictionary\f[R] \f[I]y/N\f[R] Show dictionary entry of original text or not. (default: no) .RS .PP This option is enabled in dictionary mode. .RE .TP .B \f[B]\-show\-dictionary\f[R] \f[I]Y/n\f[R] Show dictionary entry of translation or not. (default: yes) .TP .B \f[B]\-show\-alternatives\f[R] \f[I]Y/n\f[R] Show alternative translations or not. (default: yes) .TP .B \f[B]\-w\f[R] \f[I]NUM\f[R], \f[B]\-width\f[R] \f[I]NUM\f[R] Specify the screen width for padding. .RS .PP This option overrides the setting of environment variable $\f[B]COLUMNS\f[R]. .RE .TP .B \f[B]\-indent\f[R] \f[I]NUM\f[R] Specify the size of indent (number of spaces). (default: 4) .TP .B \f[B]\-theme\f[R] \f[I]FILENAME\f[R] Specify the theme to use. (default: default) .TP .B \f[B]\-no\-theme\f[R] Do not use any other theme than default. .TP .B \f[B]\-no\-ansi\f[R] Do not use ANSI escape codes. .TP .B \f[B]\-no\-autocorrect\f[R] Do not autocorrect. (if defaulted by the translation engine) .TP .B \f[B]\-no\-bidi\f[R] Do not convert bidirectional texts. .TP .B \f[B]\-bidi\f[R] Always convert bidirectional texts. .TP .B \f[B]\-no\-warn\f[R] Do not write warning messages to stderr. .TP .B \f[B]\-dump\f[R] Print raw API response instead. .SS Audio options .TP .B \f[B]\-p\f[R], \f[B]\-play\f[R] Listen to the translation. .RS .PP You must have at least one of the supported audio players (\f[B]mplayer\f[R], \f[B]mpv\f[R] or \f[B]mpg123\f[R]) installed to stream from Google Text\-to\-Speech engine. Otherwise, a local speech synthesizer may be used instead (\f[B]say\f[R] on macOS, \f[B]espeak\f[R] on Linux or other platforms). .RE .TP .B \f[B]\-speak\f[R] Listen to the original text. .TP .B \f[B]\-n\f[R] \f[I]VOICE\f[R], \f[B]\-narrator\f[R] \f[I]VOICE\f[R] Specify the narrator, and listen to the translation. .RS .PP Common values for this option are \f[B]male\f[R] and \f[B]female\f[R]. .RE .TP .B \f[B]\-player\f[R] \f[I]PROGRAM\f[R] Specify the audio player to use, and listen to the translation. .RS .PP Option \f[B]\-play\f[R] will try to use \f[B]mplayer\f[R], \f[B]mpv\f[R] or \f[B]mpg123\f[R] by default, since these players are known to work for streaming URLs. Not all command\-line audio players can work this way. Use this option only when you have your own preference. .PP This option overrides the setting of environment variable $\f[B]PLAYER\f[R]. .RE .TP .B \f[B]\-no\-play\f[R] Do not listen to the translation. .TP .B \f[B]\-no\-translate\f[R] Do not translate anything when using \-speak. .TP .B \f[B]\-download\-audio\f[R] Download the audio to the current directory. .TP .B \f[B]\-download\-audio\-as\f[R] \f[I]FILENAME\f[R] Download the audio to the specified file. .SS Terminal paging and browsing options .TP .B \f[B]\-v\f[R], \f[B]\-view\f[R] View the translation in a terminal pager (\f[B]less\f[R], \f[B]more\f[R] or \f[B]most\f[R]). .TP .B \f[B]\-pager\f[R] \f[I]PROGRAM\f[R] Specify the terminal pager to use, and view the translation. .RS .PP This option overrides the setting of environment variable $\f[B]PAGER\f[R]. .RE .TP .B \f[B]\-no\-view\f[R], \f[B]\-no\-pager\f[R] Do not view the translation in a terminal pager. .TP .B \f[B]\-browser\f[R] \f[I]PROGRAM\f[R] Specify the web browser to use. .RS .PP This option overrides the setting of environment variable $\f[B]BROWSER\f[R]. .RE .TP .B \f[B]\-no\-browser\f[R] Do not open the web browser. .SS Networking options .TP .B \f[B]\-x\f[R] \f[I]HOST:PORT\f[R], \f[B]\-proxy\f[R] \f[I]HOST:PORT\f[R] Use HTTP proxy on given port. .RS .PP This option overrides the setting of environment variables $\f[B]HTTP_PROXY\f[R] and $\f[B]http_proxy\f[R]. .RE .TP .B \f[B]\-u\f[R] \f[I]STRING\f[R], \f[B]\-user\-agent\f[R] \f[I]STRING\f[R] Specify the User\-Agent to identify as. .RS .PP This option overrides the setting of environment variables $\f[B]USER_AGENT\f[R]. .RE .TP .B \f[B]\-4\f[R], \f[B]\-ipv4\f[R], \f[B]\-inet4\-only\f[R] Connect only to IPv4 addresses. .TP .B \f[B]\-6\f[R], \f[B]\-ipv6\f[R], \f[B]\-inet6\-only\f[R] Connect only to IPv6 addresses. .SS Interactive shell options .TP .B \f[B]\-I\f[R], \f[B]\-interactive\f[R], \f[B]\-shell\f[R] Start an interactive shell, invoking \f[B]rlwrap\f[R] whenever possible (unless \f[B]\-no\-rlwrap\f[R] is specified). .TP .B \f[B]\-E\f[R], \f[B]\-emacs\f[R] Start the GNU Emacs front\-end for an interactive shell. .RS .PP This option does not need to, and cannot be used along with \f[B]\-I\f[R] or \f[B]\-no\-rlwrap\f[R]. .RE .TP .B \f[B]\-no\-rlwrap\f[R] Do not invoke \f[B]rlwrap\f[R] when starting an interactive shell. .RS .PP This option is useful when your terminal type is not supported by \f[B]rlwrap\f[R] (e.g. \f[B]emacs\f[R]). .RE .SS I/O options .TP .B \f[B]\-i\f[R] \f[I]FILENAME\f[R], \f[B]\-input\f[R] \f[I]FILENAME\f[R] Specify the input file. .RS .PP Source text to be translated will be read from the input file, instead of standard input. .RE .TP .B \f[B]\-o\f[R] \f[I]FILENAME\f[R], \f[B]\-output\f[R] \f[I]FILENAME\f[R] Specify the output file. .RS .PP Translations will be written to the output file, instead of standard output. .RE .SS Language preference options .TP .B \f[B]\-l\f[R] \f[I]CODE\f[R], \f[B]\-hl\f[R] \f[I]CODE\f[R], \f[B]\-lang\f[R] \f[I]CODE\f[R] Specify your home language (the language you would like to see for displaying prompt messages in the translation). .RS .PP This option affects only the display in verbose mode (anything other than source language and target language will be displayed in your home language). This option has no effect in brief mode. .PP This option is optional. When its setting is omitted, English will be used. .PP This option overrides the setting of environment variables $\f[B]LC_ALL\f[R], $\f[B]LANG\f[R], and $\f[B]HOME_LANG\f[R]. .RE .TP .B \f[B]\-s\f[R] \f[I]CODES\f[R], \f[B]\-sl\f[R] \f[I]CODES\f[R], \f[B]\-source\f[R] \f[I]CODES\f[R], \f[B]\-from\f[R] \f[I]CODES\f[R] Specify the source language(s) (the language(s) of original text). When specifying two or more language codes, concatenate them by plus sign \[dq]+\[dq]. .RS .PP This option is optional. When its setting is omitted, the language of original text will be identified automatically (with a possibility of misidentification). .PP This option overrides the setting of environment variable $\f[B]SOURCE_LANG\f[R]. .RE .TP .B \f[B]\-t\f[R] \f[I]CODES\f[R], \f[B]\-tl\f[R] \f[I]CODES\f[R], \f[B]\-target\f[R] \f[I]CODES\f[R], \f[B]\-to\f[R] \f[I]CODES\f[R] Specify the target language(s) (the language(s) of translated text). When specifying two or more language codes, concatenate them by plus sign \[dq]+\[dq]. .RS .PP This option is optional. When its setting is omitted, everything will be translated into English. .PP This option overrides the setting of environment variables $\f[B]LC_ALL\f[R], $\f[B]LANG\f[R], and $\f[B]TARGET_LANG\f[R]. .RE .TP .B [\f[I]SOURCE\f[R]]:[\f[I]TARGETS\f[R]] A simpler, alternative way to specify the source language and target language(s) is to use a shortcut formatted string: .RS .IP \[bu] 2 \f[I]SOURCE\-CODE\f[R]:\f[I]TARGET\-CODE\f[R] .IP \[bu] 2 \f[I]SOURCE\-CODE\f[R]:\f[I]TARGET\-CODE1\f[R]+\f[I]TARGET\-CODE2\f[R]+... .IP \[bu] 2 \f[I]SOURCE\-CODE\f[R]=\f[I]TARGET\-CODE\f[R] .IP \[bu] 2 \f[I]SOURCE\-CODE\f[R]=\f[I]TARGET\-CODE1\f[R]+\f[I]TARGET\-CODE2\f[R]+... .PP Delimiter \[dq]:\[dq] and \[dq]=\[dq] can be used interchangeably. .PP Either \f[I]SOURCE\f[R] or \f[I]TARGETS\f[R] may be omitted, but the delimiter character must be kept. .RE .SS Text preprocessing options .TP .B \f[B]\-j\f[R], \f[B]\-join\-sentence\f[R] Treat all arguments as one single sentence. .SS Other options .TP .B \f[B]\-no\-init\f[R] Do not load any initialization script. .TP .B \f[B]\-\-\f[R] End\-of\-options. .RS .PP All arguments after this option are treated as \f[I]TEXT\f[R] to be translated. .RE .SH EXIT STATUS .TP .B \f[B]0\f[R] Successful translation. .TP .B \f[B]1\f[R] Error. .SH ENVIRONMENT .TP .B \f[B]PAGER\f[R] Equivalent to option setting \f[B]\-pager\f[R]. .TP .B \f[B]BROWSER\f[R] Equivalent to option setting \f[B]\-browser\f[R]. .TP .B \f[B]PLAYER\f[R] Equivalent to option setting \f[B]\-player\f[R]. .TP .B \f[B]HTTP_PROXY\f[R] Equivalent to option setting \f[B]\-proxy\f[R]. .TP .B \f[B]USER_AGENT\f[R] Equivalent to option setting \f[B]\-user\-agent\f[R]. .TP .B \f[B]HOME_LANG\f[R] Equivalent to option setting \f[B]\-lang\f[R]. .TP .B \f[B]SOURCE_LANG\f[R] Equivalent to option setting \f[B]\-source\f[R]. .TP .B \f[B]TARGET_LANG\f[R] Equivalent to option setting \f[B]\-target\f[R]. .SH FILES .TP .B \f[I]/etc/translate\-shell\f[R] Initialization script. (system\-wide) .TP .B \f[I]$HOME/.translate\-shell/init.trans\f[R] Initialization script. (user\-specific) .TP .B \f[I]$XDG_CONFIG_HOME/translate\-shell/init.trans\f[R] Initialization script. (user\-specific) .TP .B \f[I]./.trans\f[R] Initialization script. (current directory) .SH FURTHER DOCUMENTATION .PP .SH REPORTING BUGS .PP .SH AUTHORS Mort Yao .