TRANS(1)

๐Ÿ“ฆ
version 0.9.7.1 ยท 2 versions
  • 0.9.7.1 ยท alpine 3.24, arch rolling, debian bookworm, debian trixie, epel 10, epel 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.9.6.12 ยท ubuntu jammy
, in alpine 3.24, arch rolling, debian bookworm, debian trixie, epel 10, epel 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

๐Ÿ’– TRANS(1) โ€” the translate-shell glow-up ๐Ÿ’–

ok so bestie. welcome to trans, the command-line translator that literally speaks every language. it's from the translate-shell manual (section 1, iykyk), and it's giving main character energy in your terminal. ๐Ÿฆ‹


โœจ NAME โœจ

trans โ€” your command-line translator, slaying via Google Translate, Bing Translator, Yandex.Translate, etc. no cap. ๐ŸŒˆ


โœจ SYNOPSIS โœจ

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

โœจ DESCRIPTION โœจ

okay so. this tool translates text into literally any language, straight from the command line, using a translation engine like Google Translate, Bing Translator and Yandex.Translate. it's giving polyglot. ๐Ÿ’…

every argument that isn't a valid option? that's treated as TEXT to be translated. periodt.

and if neither TEXT nor the input file is specified by command-line arguments, the program will read and translate from standard input. it just knows. ๐Ÿ”ฎ


โœจ OPTIONS โœจ

๐ŸŒธ Information options ๐ŸŒธ

  • -V, -version โ€” print version and exit. quick lil flex. โœจ
  • -H, -help โ€” print help message and exit. ๐Ÿซถ
  • -M, -man โ€” show man page and exit. (hi, that's literally this one ๐ŸŽ€)
  • -T, -reference โ€” 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). so fancy. ๐Ÿ‘‘
  • -R, -reference-english โ€” same reference table energy, all supported languages and codes, and exit. but this time names of languages are displayed in English. ๐Ÿ‡ฌ๐Ÿ‡ง
  • -S, -list-engines โ€” list available translation engines and exit. ๐Ÿ”ฅ
  • -list-languages โ€” list all supported languages (in endonyms) and exit. ๐ŸŒ
  • -list-languages-english โ€” list all supported languages (in English names) and exit. ๐ŸŒŽ
  • -list-codes โ€” list all supported codes and exit. ๐Ÿ”ข
  • -list-all โ€” list all supported languages (endonyms and English names) and codes, and exit. the whole buffet. ๐Ÿ“
  • -L CODES, -linguist CODES โ€” print details of languages and exit. When specifying two or more language codes, concatenate them by plus sign "+". ๐Ÿงš
  • -U, -upgrade โ€” check for upgrade of this program. glow-up check. ๐Ÿ’…

๐ŸŒธ Translator options ๐ŸŒธ

  • -e ENGINE, -engine ENGINE โ€” specify the translation engine to use. (default: auto)

๐ŸŒธ Display options ๐ŸŒธ

  • -verbose โ€” verbose mode.

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).

This option is unnecessary in most cases since verbose mode is enabled by default. so it's lowkey just vibing already. ๐Ÿ™ˆ

  • -b, -brief โ€” brief mode.

Show the most relevant translation or its phonetic notation only. short & sweet. โœจ

  • -d, -dictionary โ€” dictionary mode.

Show the definition of the original word in the dictionary. ๐Ÿ“–

  • -identify โ€” language identification.

Show the identified language of the original text. detective era. ๐Ÿ”

  • -show-original Y/n โ€” show original text or not. (default: yes)
  • -show-original-phonetics Y/n โ€” show phonetic notation of original text or not. (default: yes)
  • -show-translation Y/n โ€” show translation or not. (default: yes)
  • -show-translation-phonetics Y/n โ€” show phonetic notation of translation or not. (default: yes)
  • -show-prompt-message Y/n โ€” show prompt message or not. (default: yes)
  • -show-languages Y/n โ€” show source and target languages or not. (default: yes)
  • -show-original-dictionary y/N โ€” show dictionary entry of original text or not. (default: no)

This option is enabled in dictionary mode.

  • -show-dictionary Y/n โ€” show dictionary entry of translation or not. (default: yes)
  • -show-alternatives Y/n โ€” show alternative translations or not. (default: yes)
  • -w NUM, -width NUM โ€” specify the screen width for padding.

This option overrides the setting of environment variable $COLUMNS.

  • -indent NUM โ€” specify the size of indent (number of spaces). (default: 4)
  • -theme FILENAME โ€” specify the theme to use. (default: default)
  • -no-theme โ€” do not use any other theme than default.
  • -no-ansi โ€” do not use ANSI escape codes.
  • -no-autocorrect โ€” do not autocorrect. (if defaulted by the translation engine)
  • -no-bidi โ€” do not convert bidirectional texts.
  • -bidi โ€” always convert bidirectional texts.
  • -no-warn โ€” do not write warning messages to stderr.
  • -dump โ€” print raw API response instead. the raw tea. โ˜•

๐ŸŒธ Audio options ๐ŸŒธ

  • -p, -play โ€” listen to the translation. ๐Ÿ”Š

You must have at least one of the supported audio players (mplayer, mpv or mpg123) installed to stream from Google Text-to-Speech engine. Otherwise, a local speech synthesizer may be used instead (say on macOS, espeak on Linux or other platforms).

  • -speak โ€” listen to the original text.
  • -n VOICE, -narrator VOICE โ€” specify the narrator, and listen to the translation.

Common values for this option are male and female.

  • -player PROGRAM โ€” specify the audio player to use, and listen to the translation.

Option -play will try to use mplayer, mpv or mpg123 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.

This option overrides the setting of environment variable $PLAYER.

  • -no-play โ€” do not listen to the translation.
  • -no-translate โ€” do not translate anything when using -speak.
  • -download-audio โ€” download the audio to the current directory.
  • -download-audio-as FILENAME โ€” download the audio to the specified file.

๐ŸŒธ Terminal paging and browsing options ๐ŸŒธ

  • -v, -view โ€” view the translation in a terminal pager (less, more or most).
  • -pager PROGRAM โ€” specify the terminal pager to use, and view the translation.

This option overrides the setting of environment variable $PAGER.

  • -no-view, -no-pager โ€” do not view the translation in a terminal pager.
  • -browser PROGRAM โ€” specify the web browser to use.

This option overrides the setting of environment variable $BROWSER.

  • -no-browser โ€” do not open the web browser.

๐ŸŒธ Networking options ๐ŸŒธ

  • -x HOST:PORT, -proxy HOST:PORT โ€” use HTTP proxy on given port.

This option overrides the setting of environment variables $HTTP_PROXY and $http_proxy.

  • -u STRING, -user-agent STRING โ€” specify the User-Agent to identify as.

This option overrides the setting of environment variables $USER_AGENT.

  • -4, -ipv4, -inet4-only โ€” connect only to IPv4 addresses.
  • -6, -ipv6, -inet6-only โ€” connect only to IPv6 addresses.

๐ŸŒธ Interactive shell options ๐ŸŒธ

  • -I, -interactive, -shell โ€” start an interactive shell, invoking rlwrap whenever possible (unless -no-rlwrap is specified).
  • -E, -emacs โ€” start the GNU Emacs front-end for an interactive shell.

This option does not need to, and cannot be used along with -I or -no-rlwrap.

  • -no-rlwrap โ€” do not invoke rlwrap when starting an interactive shell.

This option is useful when your terminal type is not supported by rlwrap (e.g. emacs).

๐ŸŒธ I/O options ๐ŸŒธ

  • -i FILENAME, -input FILENAME โ€” specify the input file.

Source text to be translated will be read from the input file, instead of standard input.

  • -o FILENAME, -output FILENAME โ€” specify the output file.

Translations will be written to the output file, instead of standard output.

๐ŸŒธ Language preference options ๐ŸŒธ

  • -hl CODE, -host CODE โ€” specify your home language (the language you would like to see for displaying prompt messages in the translation).

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.

This option is optional. When its setting is omitted, English will be used.

This option overrides the setting of environment variables $LC_ALL, $LANG, and $HOST_LANG.

  • -s CODES, -sl CODES, -source CODES, -from CODES โ€” specify the source language(s) (the language(s) of original text). When specifying two or more language codes, concatenate them by plus sign "+".

This option is optional. When its setting is omitted, the language of original text will be identified automatically (with a possibility of misidentification).

This option overrides the setting of environment variable $SOURCE_LANG.

  • -t CODES, -tl CODES, -target CODES, -to CODES โ€” specify the target language(s) (the language(s) of translated text). When specifying two or more language codes, concatenate them by plus sign "+".

This option is optional. When its setting is omitted, everything will be translated into English.

This option overrides the setting of environment variables $LC_ALL, $LANG, and $TARGET_LANG.

  • [SOURCE]:[TARGETS] โ€” a simpler, alternative way to specify the source language and target language(s) is to use a shortcut formatted string:
    • SOURCE-CODE:TARGET-CODE
    • SOURCE-CODE:TARGET-CODE1+TARGET-CODE2+...
    • SOURCE-CODE=TARGET-CODE
    • SOURCE-CODE=TARGET-CODE1+TARGET-CODE2+...

Delimiter ":" and "=" can be used interchangeably.

Either SOURCE or TARGETS may be omitted, but the delimiter character must be kept.

๐ŸŒธ Text preprocessing options ๐ŸŒธ

  • -j, -join-sentence โ€” treat all arguments as one single sentence. glue them together fr fr. ๐Ÿซถ

๐ŸŒธ Other options ๐ŸŒธ

  • -no-init โ€” do not load any initialization script.
  • -- โ€” end-of-options.

All arguments after this option are treated as TEXT to be translated.


โœจ EXIT STATUS โœจ

  • 0 โ€” successful translation. we ate. ๐Ÿ’…
  • 1 โ€” error. ๐Ÿ˜ญ

โœจ ENVIRONMENT โœจ

  • PAGER โ€” equivalent to option setting -pager.
  • BROWSER โ€” equivalent to option setting -browser.
  • PLAYER โ€” equivalent to option setting -player.
  • HTTP_PROXY โ€” equivalent to option setting -proxy.
  • USER_AGENT โ€” equivalent to option setting -user-agent.
  • HOST_LANG โ€” equivalent to option setting -host.
  • SOURCE_LANG โ€” equivalent to option setting -source.
  • TARGET_LANG โ€” equivalent to option setting -target.

โœจ FILES โœจ

  • /etc/translate-shell โ€” initialization script. (system-wide) ๐Ÿ 
  • $HOME/.translate-shell/init.trans โ€” initialization script. (user-specific)
  • $XDG_CONFIG_HOME/translate-shell/init.trans โ€” initialization script. (user-specific)
  • ./.trans โ€” initialization script. (current directory)

to be continued bestieโ€ฆ part 2 is coming ๐Ÿ’œ

๐Ÿ’– FURTHER DOCUMENTATION ๐Ÿ’–

ok so you want more? valid. the wiki is right there and it's lowkey a whole vibe:

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

go read it bestie, it's giving "extra credit but make it cute" ๐Ÿฆ‹


๐Ÿซถ REPORTING BUGS ๐Ÿซถ

found something broken? not me being dramatic but pls tell them. the issue tracker is literally right here:

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

no gatekeeping, no "it's probably just me" โ€” if it's weird, report it. the maintainers wanna know fr fr ๐Ÿ›โœจ


๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

Mort Yao <soi@mort.ninja>.

that's the main character right there. show some respect ๐Ÿ’…๐ŸŒธ


and that's the whole page, bestie!! ๐ŸŽ€

just so you know what you're reading: this is TRANS(1), version 0.9.7.1, dated 2023-02-08. go translate something iconic. iykyk ๐ŸŒˆโญ๐Ÿ’œ

bye babes!! ๐Ÿฆ‹โœจ