:speech_balloon: Command-line translator using Google Translate, Bing Translator, Yandex.Translate, etc.

Related tags

translate-shell
Overview

Translate Shell

Icon CircleCI Actions Version Download Gitter

Translate Shell (formerly Google Translate CLI) is a command-line translator powered by Google Translate (default), Bing Translator, Yandex.Translate, and Apertium. It gives you easy access to one of these translation engines in your terminal:

$ trans 'Saluton, Mondo!'
Saluton, Mondo!

Hello, World!

Translations of Saluton, Mondo!
[ Esperanto -> English ]
Saluton ,
    Hello,
Mondo !
    World!

By default, translations with detailed explanations are shown. You can also translate the text briefly: (only the most relevant translation will be shown)

$ trans -brief 'Saluton, Mondo!'
Hello, World!

Translate Shell can also be used like an interactive shell; input the text to be translated line by line:

$ trans -shell -brief
> Rien ne réussit comme le succès.
Nothing succeeds like success.
> Was mich nicht umbringt, macht mich stärker.
What does not kill me makes me stronger.
> Юмор есть остроумие глубокого чувства.
Humor has a deep sense of wit.
> 學而不思則罔,思而不學則殆。
Learning without thought is labor lost, thought without learning is perilous.
> 幸福になるためには、人から愛されるのが一番の近道。
In order to be happy, the best way is to be loved by people.

Prerequisites

System Requirements

Translate Shell is known to work on many POSIX-compliant systems, including but not limited to:

  • GNU/Linux
  • macOS
  • *BSD
  • Android (through Termux)
  • Windows (through WSL, Cygwin, or MSYS2)

Dependencies

  • GNU Awk (gawk) 4.0 or later
    • This program relies heavily on GNU extensions of the AWK language, which are non-portable for other AWK implementations (e.g. nawk).
    • How to get gawk:
      • gawk comes with all GNU/Linux distributions.
      • On FreeBSD, gawk is available in the ports.
      • On macOS, gawk is available in MacPorts and Homebrew.
  • GNU Bash or Zsh
    • You may use Translate Shell from any Unix shell of your choice (bash, zsh, ksh, tcsh, fish, etc.); however, the wrapper script requires either bash or zsh installed.

Recommended Dependencies

These dependencies are optional, but strongly recommended for full functionality:

  • curl with OpenSSL support
  • GNU FriBidi: an implementation of the Unicode Bidirectional Algorithm (bidi)
    • required for displaying text in Right-to-Left scripts (e.g. Arabic, Hebrew)
  • mplayer, mpv, mpg123, or eSpeak
    • required for the Text-to-Speech functionality
  • less, more or most
    • required for terminal paging
  • rlwrap: a GNU readline wrapper
    • required for readline-style editing and history in the interactive shell
  • aspell or hunspell
    • required for spell checking

Environment and Fonts

It is a must to have corresponding fonts for the language(s) / script(s) you wish to display in your terminal. See wiki: Writing Systems and Fonts for more details on scripts and recommended Unicode fonts.

Try It Out!

Start an interactive shell and translate anything you input into your native language: (in bash or zsh)

$ gawk -f <(curl -Ls --compressed https://git.io/translate) -- -shell

(in fish)

$ gawk -f (curl -Ls --compressed https://git.io/translate | psub) -- -shell

Using Docker

To try out via Docker, run:

$ docker pull soimort/translate-shell

Then you may start an interactive shell from the Docker image for translating:

$ docker run -it soimort/translate-shell -shell

Installation

Option #1. Direct Download

Download the self-contained executable and place it into your path. It's everything you need.

$ wget git.io/trans
$ chmod +x ./trans

There is a GPG signature.

Option #2. From A Package Manager

Using your favorite package manager

See wiki: Distros on how to install from a specific package manager on your distro.

Using Antigen (for Zsh users)

Add the following line to your .zshrc:

antigen bundle soimort/translate-shell

Option #3. From Git

$ git clone https://github.com/soimort/translate-shell
$ cd translate-shell/
$ make
$ [sudo] make install

In case you have only zsh but not bash in your system, build with:

$ make TARGET=zsh

The default PREFIX of installation is /usr/local. To install the program to somewhere else (e.g. /usr, ~/.local), use:

$ [sudo] make PREFIX=/usr install

Getting Started by Examples

Translate a Word

From any language to your language

Google Translate can identify the language of the source text automatically, and Translate Shell by default translates the source text into the language of your locale.

$ trans vorto

From any language to one or more specific languages

Translate a word into French:

$ trans :fr word

Translate a word into Chinese and Japanese: (use a plus sign "+" as the delimiter)

$ trans :zh+ja word

Alternatively, equals sign ("=") can be used in place of the colon (":"). Note that in some shells (e.g. zsh), equals signs may be interpreted differently, therefore the argument specifying languages needs to be protected:

$ trans {=zh+ja} word
$ trans '=zh+ja' word

You can also use the -target (-t) option to specify the target language(s):

$ trans -t zh+ja word

With the -t option, the name of the language may also be used instead of the language code:

$ trans -t japanese word
$ trans -t 日本語 word

From a specific language

Google Translate may wrongly identify the source text as some other language than you expected:

$ trans 手紙

In that case, you need to specify its language explicitly:

$ trans ja: 手紙
$ trans zh: 手紙

You can also use the -source (-s) option to specify the source language:

$ trans -s ja 手紙

Translate Multiple Words or a Phrase

Translate each word alone:

$ trans en:zh word processor

Put words into one argument, and translate them as a whole:

$ trans en:zh "word processor"

Translate a Sentence

Translating a sentence is much the same like translating a phrase; you can just quote the sentence into one argument:

$ trans :zh "To-morrow, and to-morrow, and to-morrow,"
$ trans :zh 'To-morrow, and to-morrow, and to-morrow,'

It is also possible to translate multi-line sentences:

$ trans :zh "Creeps in this petty pace from day to day,
> To the last syllable of recorded time;
> And all our yesterdays have lighted fools
> The way to dusty death."

To avoid punctuation marks (e.g. "!") or other special characters being interpreted by the shell, use single quotes:

$ trans :zh 'Out, out, brief candle!'

There are some cases though, you may still want to use double quotes: (e.g. the sentence contains a single quotation mark "'")

$ trans :zh "Life's but a walking shadow, a poor player"

Alternatively, use the -join-sentence (-j) option to treat all arguments as one sentence so that quotes can be omitted:

$ trans -j :zh Life\'s but a walking shadow, a poor player

Brief Mode

By default, Translate Shell displays translations in a verbose manner. If you prefer to see only the most relevant translation, there is a brief mode available using the -brief (-b) option:

$ trans -b :fr "Saluton, Mondo"

In brief mode, phonetic notation (if any) is not shown by default. To enable this, put an at sign "@" in front of the language code:

$ trans -b :@ja "Saluton, Mondo"

Dictionary Mode

Google Translate can be used as a dictionary. When translating a word and the target language is the same as the source language, the dictionary entry of the word is shown:

$ trans :en word

To enable dictionary mode no matter whether the source language and the target language are identical, use the -dictionary (-d) option.

$ trans -d fr: mot

Note: Not every language supported by Google Translate has provided dictionary data. See wiki: Languages to find out which language(s) has dictionary support.

Language Identification

Use the -identify (-id) option to identify the language of the text:

$ trans -id 言葉

Text-to-Speech

Use the -play (-p) option to listen to the translation:

$ trans -b -p :ja "Saluton, Mondo"

Use the -speak (-sp) option to listen to the original text:

$ trans -sp "你好,世界"

Terminal Paging

Sometimes the content of translation can be too much for display in one screen. Use the -view (-v) option to view the translation in a terminal pager such as less or more:

$ trans -d -v word

Right-to-Left (RTL) Languages

Right-to-Left (RTL) languages are well supported via GNU FriBidi.

The program will automatically adjust the screen width for padding when displaying right-to-left languages. Alternatively, you may use the -width (-w) option to specify the screen width:

$ trans -b -w 40 :he "Saluton, Mondo"

See wiki: Languages to find out which language(s) uses a Right-to-Left writing system.

Pipeline, Input and Output

If no source text is given in command-line arguments, the program will read from standard input, or from the file specified by the -input (-i) option:

$ echo "Saluton, Mondo" | trans -b :fr
$ trans -b -i input.txt :fr

Translations are written to standard output, or to the file specified by the -output (-o) option:

$ echo "Saluton, Mondo" | trans -b -o output.txt :fr

Translate a File

Instead of using the -input option, a file URI scheme (file:// followed by the file name) can be used as a command-line argument:

$ trans :fr file://input.txt

Note: Brief mode is used when translating from file URI schemes.

Translate a Web Page

To translate a web page, an http(s) URI scheme can be used as an argument:

$ trans :fr http://www.w3.org/

A browser session will open for viewing the translation (via Google Translate's web interface). To specify your web browser of choice, use the -browser option:

$ trans -browser firefox :fr http://www.w3.org/

Language Details

Use the -list (-L) option to view details of one or more languages:

$ trans -L fr
$ trans -L de+en

Some basic information of the language will be displayed: its English name and endonym (language name in the language itself), language family, writing system, canonical Google Translate code and ISO 639-3 code.

Interactive Translate Shell (REPL)

Start an interactive shell using the -shell (or -interactive, -I) option:

$ trans -shell

You may specify the source language and the target language(s) before starting an interactive shell:

$ trans -shell en:fr

You may also change these settings during an interactive session. See wiki: REPL for more advanced usage of the interactive Translate Shell.

Usage

For more details on command-line options, see the man page trans(1) or use trans -M in a terminal.

Usage:  trans [OPTIONS] [SOURCES]:[TARGETS] [TEXT]...

Information options:
    -V, -version
        Print version and exit.
    -H, -help
        Print help message and exit.
    -M, -man
        Show man page and exit.
    -T, -reference
        Print reference table of languages and exit.
    -R, -reference-english
        Print reference table of languages (in English names) and exit.
    -L CODES, -list CODES
        Print details of languages and exit.
    -S, -list-engines
        List available translation engines and exit.
    -U, -upgrade
        Check for upgrade of this program.

Translator options:
    -e ENGINE, -engine ENGINE
        Specify the translation engine to use.

Display options:
    -verbose
        Verbose mode. (default)
    -b, -brief
        Brief mode.
    -d, -dictionary
        Dictionary mode.
    -identify
        Language identification.
    -show-original Y/n
        Show original text or not.
    -show-original-phonetics Y/n
        Show phonetic notation of original text or not.
    -show-translation Y/n
        Show translation or not.
    -show-translation-phonetics Y/n
        Show phonetic notation of translation or not.
    -show-prompt-message Y/n
        Show prompt message or not.
    -show-languages Y/n
        Show source and target languages or not.
    -show-original-dictionary y/N
        Show dictionary entry of original text or not.
    -show-dictionary Y/n
        Show dictionary entry of translation or not.
    -show-alternatives Y/n
        Show alternative translations or not.
    -w NUM, -width NUM
        Specify the screen width for padding.
    -indent NUM
        Specify the size of indent (number of spaces).
    -theme FILENAME
        Specify the theme to use.
    -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.

Audio options:
    -p, -play
        Listen to the translation.
    -speak
        Listen to the original text.
    -n VOICE, -narrator VOICE
        Specify the narrator, and listen to the translation.
    -player PROGRAM
        Specify the audio player to use, and listen to the translation.
    -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.
    -pager PROGRAM
        Specify the terminal pager to use, and view the translation.
    -no-view, -no-pager
        Do not view the translation in a terminal pager.
    -browser PROGRAM
        Specify the web browser to use.
    -no-browser
        Do not open the web browser.

Networking options:
    -x HOST:PORT, -proxy HOST:PORT
        Use HTTP proxy on given port.
    -u STRING, -user-agent STRING
        Specify the User-Agent to identify as.
    -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.
    -E, -emacs
        Start the GNU Emacs front-end for an interactive shell.
    -no-rlwrap
        Do not invoke rlwrap when starting an interactive shell.

I/O options:
    -i FILENAME, -input FILENAME
        Specify the input file.
    -o FILENAME, -output FILENAME
        Specify the output file.

Language preference options:
    -l CODE, -hl CODE, -lang CODE
        Specify your home language.
    -s CODES, -sl CODES, -source CODES, -from CODES
        Specify the source language(s), joined by '+'.
    -t CODES, -tl CODES, -target CODES, -to CODES
        Specify the target language(s), joined by '+'.

Text preprocessing options:
    -j, -join-sentence
        Treat all arguments as one single sentence.

Other options:
    -no-init
        Do not load any initialization script.

See the man page trans(1) for more information.

Code List

Use trans -R or trans -T to view the reference table in a terminal.

For more details on languages and corresponding codes, see wiki: Languages.

Language Code Language Code Language Code
Afrikaans
Afrikaans
af Hill Mari
Кырык мары
mrj Portuguese
Português
pt
Albanian
Shqip
sq Hindi
हिन्दी
hi Punjabi
ਪੰਜਾਬੀ
pa
Amharic
አማርኛ
am Hmong
Hmoob
hmn Querétaro Otomi
Hñąñho
otq
Arabic
العربية
ar Hmong Daw
Hmoob Daw
mww Romanian
Română
ro
Armenian
Հայերեն
hy Hungarian
Magyar
hu Russian
Русский
ru
Azerbaijani
Azərbaycanca
az Icelandic
Íslenska
is Samoan
Gagana Sāmoa
sm
Bashkir
башҡорт теле
ba Igbo
Igbo
ig Scots Gaelic
Gàidhlig
gd
Basque
Euskara
eu Indonesian
Bahasa Indonesia
id Serbian (Cyrillic)
српски
sr-Cyrl
Belarusian
беларуская
be Irish
Gaeilge
ga Serbian (Latin)
srpski
sr-Latn
Bengali
বাংলা
bn Italian
Italiano
it Sesotho
Sesotho
st
Bosnian
Bosanski
bs Japanese
日本語
ja Shona
chiShona
sn
Bulgarian
български
bg Javanese
Basa Jawa
jv Sindhi
سنڌي
sd
Cantonese
粵語
yue Kannada
ಕನ್ನಡ
kn Sinhala
සිංහල
si
Catalan
Català
ca Kazakh
Қазақ тілі
kk Slovak
Slovenčina
sk
Cebuano
Cebuano
ceb Khmer
ភាសាខ្មែរ
km Slovenian
Slovenščina
sl
Chichewa
Nyanja
ny Kinyarwanda
Ikinyarwanda
rw Somali
Soomaali
so
Chinese Simplified
简体中文
zh-CN Klingon
tlhIngan Hol
tlh Spanish
Español
es
Chinese Traditional
正體中文
zh-TW Klingon (pIqaD)
 
tlh-Qaak Sundanese
Basa Sunda
su
Corsican
Corsu
co Korean
한국어
ko Swahili
Kiswahili
sw
Croatian
Hrvatski
hr Kurdish
Kurdî
ku Swedish
Svenska
sv
Czech
Čeština
cs Kyrgyz
Кыргызча
ky Tahitian
Reo Tahiti
ty
Danish
Dansk
da Lao
ລາວ
lo Tajik
Тоҷикӣ
tg
Dutch
Nederlands
nl Latin
Latina
la Tamil
தமிழ்
ta
Eastern Mari
Олык марий
mhr Latvian
Latviešu
lv Tatar
татарча
tt
Emoji
Emoji
emj Lithuanian
Lietuvių
lt Telugu
తెలుగు
te
English
English
en Luxembourgish
Lëtzebuergesch
lb Thai
ไทย
th
Esperanto
Esperanto
eo Macedonian
Македонски
mk Tongan
Lea faka-Tonga
to
Estonian
Eesti
et Malagasy
Malagasy
mg Turkish
Türkçe
tr
Fijian
Vosa Vakaviti
fj Malay
Bahasa Melayu
ms Turkmen
Türkmen
tk
Filipino
Tagalog
tl Malayalam
മലയാളം
ml Udmurt
удмурт
udm
Finnish
Suomi
fi Maltese
Malti
mt Ukrainian
Українська
uk
French
Français
fr Maori
Māori
mi Urdu
اُردُو
ur
Frisian
Frysk
fy Marathi
मराठी
mr Uyghur
ئۇيغۇر تىلى
ug
Galician
Galego
gl Mongolian
Монгол
mn Uzbek
Oʻzbek tili
uz
Georgian
ქართული
ka Myanmar
မြန်မာစာ
my Vietnamese
Tiếng Việt
vi
German
Deutsch
de Nepali
नेपाली
ne Welsh
Cymraeg
cy
Greek
Ελληνικά
el Norwegian
Norsk
no Xhosa
isiXhosa
xh
Gujarati
ગુજરાતી
gu Oriya
ଓଡ଼ିଆ
or Yiddish
ייִדיש
yi
Haitian Creole
Kreyòl Ayisyen
ht Papiamento
Papiamentu
pap Yoruba
Yorùbá
yo
Hausa
Hausa
ha Pashto
پښتو
ps Yucatec Maya
Màaya T'àan
yua
Hawaiian
ʻŌlelo Hawaiʻi
haw Persian
فارسی
fa Zulu
isiZulu
zu
Hebrew
עִבְרִית
he Polish
Polski
pl

Wiki

Lists of all languages, writing systems and fonts for reference:

The following pages demonstrate the advanced usage of Translate Shell:

Find out whether your Linux distribution has included Translate Shell in its official repository. If not, contribute one:

Frequently Asked Questions, historical stuff, AWK coding style, etc.:

Reporting Bugs / Contributing

Please review the guidelines for contributing before reporting an issue or sending a pull request.

Licensing

This is free and unencumbered software released into the public domain. See LICENSE and WAIVER for details.

Issues
  • "Something went wrong" error

    I just installed translate-shell via Homebrew and I'm getting this error every time I'm attempting to translate something.

    Command entered

    trans vorto
    

    Actual output

    [ERROR] Oops! Something went wrong and I can't translate it for you :(
    

    Output of trans -V

    Translate Shell       0.9.0.4-release
    
    platform
    gawk (GNU Awk)        4.1.3
    fribidi (GNU FriBidi) 0.19.6
    audio player          mplayer
    terminal pager        less
    terminal type         xterm-256color
    user locale           en_US.UTF-8 (English)
    home language         en
    source language       auto
    target language       en
    theme                 default
    init file             [NONE]
    
    Report bugs to:       https://github.com/soimort/translate-shell/issues
    

    I wish I could be more helpful, but the error message is not very descriptive. I'm running OS X 10.10.4, and I have all the latest dependencies installed.

    opened by alescode 20
  • Why is translate-shell so slow?

    Why is translate-shell so slow?

    With all engines the response is very slow, e.g. (from time): Yandex real 0m7.924s user 0m0.406s sys 0m3.656s

    Google real 0m5.959s user 0m2.156s sys 0m3.266s

    In a browser, the response is instantenous

    question 
    opened by qwer1304 20
  • Submit Homebrew formula to core

    Submit Homebrew formula to core

    Would you mind if I submit this project to Homebrew core? That would provide at least three benefits:

    1. (Biggest user-facing benefit) Auto upgrade. A formula installed via a remote .rb file won't be upgraded when brew upgrade --all is run. The only way to upgrade AFAIK is to manually reinstall, so for users who don't follow the project's releases closely, chances are good that it will never be upgraded.
    2. Basic tests are run on Brew Test Bot to ensure a release works on OS X before distributing to users;
    3. You could take this thing off your shoulder. I subscribe to translate-shell's release feed, so I (or anyone else interested) can update the core formula reasonably soon after each release. (I already keep several other core formulae updated, and so far I've been doing a decent job, typically updating the formula hours within a release.)

    If you approve, I'll submit the following to core:

    class TranslateShell < Formula
      desc "Command-line translator using Google Translate and more."
      homepage "https://www.soimort.org/translate-shell"
      url "https://github.com/soimort/translate-shell/archive/v0.9.3.1.tar.gz"
      sha256 "7b5a2404ead919570cfa4d741c521ed7e124bbf27d6f5de1a6a598e7e713c2a6"
      head "https://github.com/soimort/translate-shell.git", :branch => "develop"
    
      depends_on "fribidi"
      depends_on "gawk"
      depends_on "mplayer"
      depends_on "rlwrap"
    
      def install
        system "make", "PREFIX=#{prefix}"
        system "make", "test"
        bin.install "build/trans"
        man1.install "man/trans.1"
      end
    
      test do
        assert_equal shell_output("#{bin}/trans -b -s fr -t en bonjour"), "Hello\n"
      end
    end
    

    A few notes:

    1. I shortened the description because desc + formula name should not exceed 80 characters in length;
    2. I'm calling bin.install and man1.install to manually install the binary and man page because the install target doesn't work on OS X (OS X uses a very old version of install that doesn't have -D);
    3. I'm making fribidi a dependency (contrary to https://www.soimort.org/translate-shell/translate-shell.rb where fribidi is marked as optional) because (1) fribidi is lightweight so it doesn't hurt; (2) I don't see how fribidi is more optional than the other dependencies.
    opened by zmwangx 19
  • Null response as of today (17 Dec 2015)

    Null response as of today (17 Dec 2015)

    $ trans 'Goodbye Google'
    [ERROR] Null response.
    [ERROR] Oops! Something went wrong and I can't translate it for you :(
    
    $ proxychains -q trans 'Goodbye Google'
    [ERROR] Null response.
    [ERROR] Oops! Something went wrong and I can't translate it for you :(
    
    !important 
    opened by soimort 19
  • UTF-8 check misses locales with `utf8` extension

    UTF-8 check misses locales with `utf8` extension

    trans always complains that my locale codeset is not UTF-8, which is wrong: [WARNING] Your locale codeset (en_US.utf8) is not UTF-8. You have been warned.

    echo $LANG outputs en_US.utf8. I have to admit that my LC_CTYPE environment variable is not set, but I don't think I have to, because setting LANG should be enough:

    LANG If this environment variable is defined, its value specifies the locale to use for all purposes except as overridden by the variables above.

    The main problem is, that you are checking for some_LANG.utf-8 in Language.awk:529 but not for some_LANG.utf8.

    I am using Arch Linux with Kernel release 3.17.4-1-ARCH.

    opened by klingtnet 17
  • Problem when running Trans in the windows 10 bash app ,

    Problem when running Trans in the windows 10 bash app , "Translator not found"

    I installed the gcc/make component with mingw, and installed translate-shell from Git. However, it seems that if I enter any trans command, the following will be prompted. Why?

    $ trans -V [ERROR] Translator not found: google Run '-list-engines / -S' to see a list of available engines.

    $ trans -list-engines [ERROR] Translator not found: google Run '-list-engines / -S' to see a list of available engines.

    Thank you.

    OS-specific confirmed 
    opened by huangjiaqi1997 15
  • Trans has stopped working?

    Trans has stopped working?

    Input:

    [email protected]:~$ for engine in google bing yandex apertium; do \
        echo "$engine"; \
        trans -f en -t ja -e $engine -no-init -verbose "just testing"; \
    done
    

    Output:

    google
    
    bing
    [ERROR] Oops! Something went wrong and I can't translate it for you :(
    yandex
    [ERROR]
    
    apertium
    just testing
    
    
    
    [ English -> 日本語 ]
    

    Version:

    Translate Shell       0.9.3.2-git:6cf6a1e
    
    platform              Linux
    gawk (GNU Awk)        4.1.3
    fribidi (GNU FriBidi) 0.19.7
    audio player          mpv
    terminal pager        less
    terminal type         rxvt-unicode-256color
    user locale           en_US.UTF-8 (English)
    home language         en
    source language       auto
    target language       en
    translation engine    google
    proxy                 [NONE]
    user-agent            Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/602.1 (KHTML, like Gecko) Version/8.0 Safari/602.1 Epiphany/3.18.2
    theme                 default
    init file             [NONE]
    
    Report bugs to:       https://github.com/soimort/translate-shell/issues
    

    EDIT: judging from my command history, it has worked as far as 15:07 CET without me doing any change to the OS.

    !important 
    opened by rr- 14
  • Translate in WSL cannot work due to proxy problem

    Translate in WSL cannot work due to proxy problem

    I have zsh and antigen installed in WSL. Then I install translate-shell with the following line added in .zshrc: antigen bundle soimort/translate-shell Without any trouble, I sucessfully install the plugin: image But when I try to run trans or translate to get some usage information, I get nothing with it just running all the time. I guess it is because proxy don't work in WSL, but when I run shadowsocks in WSL as I used to do in Ubuntu, translate still not work. image I don't know what's the problem. Any help?

    But this can work: gawk -f <(curl -Ls git.io/translate) -- -shell image

    opened by huiEric 12
  • How to pass proxy with username and password?

    How to pass proxy with username and password?

    Hi

    How to pass proxy in format username:[email protected]:80 ?

    Because i always get

    gawk: /dev/fd/63:2910: fatal: remote host and port information 
    (...) invalid
    

    Thanks

    opened by ghprod 12
  • translate-shell doesn't work

    translate-shell doesn't work

    ./translate :ru you [ERROR] Null response. [ERROR] Oops! Something went wrong and I can't translate it for you :( ./translate --version Translate Shell 0.9.0.7

    platform Linux gawk (GNU Awk) 4.1.3 fribidi (GNU FriBidi) 0.19.6 audio player mpv terminal pager less terminal type xterm user locale ru_RU.utf8 (Russian) home language ru source language auto target language ru proxy [NONE] user-agent [NONE] theme default init file [NONE]

    Report bugs to: https://github.com/soimort/translate-shell/issues

    opened by conformist-mw 12
  •  New engine: please add Wiktionary

    New engine: please add Wiktionary

    Example page: definition of word boilerplate: https://en.wiktionary.org/wiki/boilerplate

    opened by vitaly-zdanevich 0
  • New engine: please add Lingvo

    New engine: please add Lingvo

    Example page: definition of word boilerplate https://www.lingvolive.com/en-us/translate/en-ru/boilerplate

    opened by vitaly-zdanevich 0
  • Bing is less reliable and more laggy than before

    Bing is less reliable and more laggy than before

    Have been using this awesome tool (hey, thank you so much!) for a while and now having trouble with it (version 0.9.6.12). Apparently, when using Bing there is a considerable delay and sometimes outright failure:

    [email protected]:~$ trans -e bing
    привет, мир!
    <second later>
    [WARNING] Connection timed out. Retrying IPv4 connection.
    <considerable delay here>
    привет, мир!
    (privet, mir!)
    
    Hello, peace!
    
    [ Русский -> English ]
    

    (and yes, Bing's translation is hilariously wrong, but that's not the point here)

    This issue does not happen when using google translate engine. I'm not sure if it's Bing changing things, but sure it is less comfortable than it was before.

    waiting for response 
    opened by v1993 1
  • Add support for the biggest English dictionaties.

    Add support for the biggest English dictionaties.

    https://www.dictionary.com/ https://dictionary.cambridge.org/ https://www.macmillandictionary.com/ https://www.merriam-webster.com/

    opened by RDKRACZ 0
  • output not fully showing in termux

    output not fully showing in termux

    when translate a bunch of words it happen

    Screenshot_2021-03-20-16-44-42

    bug confirmed 
    opened by seisdr 12
  • Why the result from trans was different from google translator on web?

    Why the result from trans was different from google translator on web?

    For example, I translate below article from english to chinese by using : trans -brief -e google en:zh "below article", but seems that the results are different from google translator. The trans result seems to get reversed paragraph order. Google API limited problem?

    FileMaker 17’s new master-detail layouts display the list of records in the user’s found set. As the user performs finds, constrains, omits, sorts, or creates or deletes records, the master-detail portal will update to stay in sync. Imagine a portal that a user can sort any way they like, filter any way they like, and click a row to see details for that row, all right out of the box. That’s the power of the master-detail portal. FileMaker Developers have long tried to approximate a master-detail layout using the tools available to us at the time. Prior to FileMaker 17 one option was to use a native list/table view, and show the details for the active record in the layout’s footer. Another option was to base a layout on an abstract global/interface table, with portals peering into related data tables. Or by using a self-join relationship that somehow figured out which records were in the user’s found set. Now we can easily display a space-efficient list on the left of the layout (or wherever you like), with the details of the active record displayed to the right of that list—with no extra code. The master-detail layout combines a bird’s-eye-view list view with a record-focused form view.

    CNR waiting for response 
    opened by jiangaq 20
  • Translating certain files (Japanese, converted from SHIFT-JIS to UTF-8) has issues

    Translating certain files (Japanese, converted from SHIFT-JIS to UTF-8) has issues

    Translating from Japanese (UTF-8) to English using default settings:

    trans -from japanese -to english file:///path/to/file.html -o out.html
    

    Results in out.html always having:

    c=function
    

    Is there a way to debug this?

    opened by ijacquez 5
  • Feature request: Urban Dictionary

    Feature request: Urban Dictionary

    Hi. Any chance Urban Dictionary could be added as an option argument?

    new translator 
    opened by dmlemos 1
  • Add support to LibreTranslate/ArgoTranslate

    Add support to LibreTranslate/ArgoTranslate

    Although recent, it seems to be a good translation tool. Opensource and with a free public API.

    https://github.com/argosopentech/argos-translate

    https://github.com/uav4geo/LibreTranslate https://libretranslate.com https://libretranslate.com/docs/

    new translator 
    opened by fabianski7 1
Releases(v0.9.6.12)
  • v0.9.6.12(May 11, 2020)

  • v0.9.6.11(Jul 25, 2019)

    • Google Translate: enforced UTF-8 URL-encoding for non-ASCII characters, fixed garbled result (#310)
    • Bing Microsoft Translator: updated to API v3, fixed support (excl. TTS) (#311)
    • Gawk 5 compatibility (#297)
    Source code(tar.gz)
    Source code(zip)
  • v0.9.6.10(Apr 19, 2019)

    • (Google Translate only) Show gender-specific translations (#274)
    • Support multiple source languages (#281)
    • GNU awk 5.0.0 compatibility (#285)
    • Fix for virtual emulators that have own BiDi support, e.g., konsole (#288)
    • New option: -bidi (enforce bidirectional conversion, #288)
    • New options: -4, -6 (choose manually IPv4 or IPv6 connection, #287)
    • Support the use of language aliases for TTS
    • New option: -no-browser (do not open the web browser, #295)
    • New option: -join-sentence (treat all arguments as one single sentence, #294)
    • Multiple fixes
    Source code(tar.gz)
    Source code(zip)
  • v0.9.6.9(Dec 23, 2018)

    Removed engine support:

    • DeepL (#272)

    Minor fixes:

    • Close command pipelines after printing to pager (#266).
    • Set minimum screen width (#269).
    Source code(tar.gz)
    Source code(zip)
  • v0.9.6.8(Aug 11, 2018)

    Fixed engine support:

    • DeepL (#237, #249)
    • Bing TTS (#218)

    New languages: (Yandex only)

    • Emoji (🤔)

    Minor fixes:

    • Close command pipelines everywhere.
    Source code(tar.gz)
    Source code(zip)
  • v0.9.6.7(Mar 17, 2018)

  • v0.9.6.6(Dec 16, 2017)

:cherry_blossom: A command-line fuzzy finder

fzf is a general-purpose command-line fuzzy finder. It's an interactive Unix filter for command-line that can be used with any list; files, command hi

Junegunn Choi 37.1k Jun 6, 2021
:mag: Google from the terminal

googler is a power tool to Google (web, news, videos and site search) from the command-line. It shows the title, URL and abstract for each result, whi

Piña Colada 5.2k Jun 6, 2021
cloc counts blank lines, comment lines, and physical lines of source code in many programming languages.

cloc Count Lines of Code cloc counts blank lines, comment lines, and physical lines of source code in many programming languages. Latest release: v1.9

null 11.7k Jun 7, 2021
Command-line program to download videos from YouTube.com and other video sites

youtube-dl - download videos from youtube.com or other video platforms INSTALLATION DESCRIPTION OPTIONS CONFIGURATION OUTPUT TEMPLATE FORMAT SELECTION

youtube-dl 95.9k Jun 5, 2021
Magnificent app which corrects your previous console command.

The Fuck The Fuck is a magnificent app, inspired by a @liamosaur tweet, that corrects errors in previous console commands. Is The Fuck too slow? Try t

Vladimir Iakovlev 62.3k Jun 5, 2021
:bookmark: Browser-independent bookmark manager

buku buku in action! Introduction buku is a powerful bookmark manager written in Python3 and SQLite3. When I started writing it, I couldn't find a fle

Piña Colada 4.5k Jun 6, 2021
Git repository summary on your terminal

A command-line Git information tool written in Rust Onefetch is a command-line Git information tool written in Rust that displays project information

Ossama Hjaji 3.1k Jun 6, 2021
A fast CSV command line toolkit written in Rust.

xsv is a command line program for indexing, slicing, analyzing, splitting and joining CSV files. Commands should be simple, fast and composable: Simpl

Andrew Gallant 7.2k Jun 5, 2021
Command-line program to download image galleries and collections from several image hosting sites

gallery-dl gallery-dl is a command-line program to download image galleries and collections from several image hosting sites (see Supported Sites). It

Mike Fährmann 3.4k Jun 7, 2021
A modern replacement for ‘ls’.

exa exa is a modern replacement for ls. README Sections: Options — Installation — Development exa is a modern replacement for the venerable file-listi

Benjamin Sago 13.5k Jun 6, 2021
:zap: A new cd command that helps you navigate faster by learning your habits.

z.lua A command line tool which helps you navigate faster by learning your habits ⚡ An alternative to z.sh with windows and posix shells support and v

Linwei 2k Jun 6, 2021
Linux Kernel Manager and Activity Monitor 🐧💻

Linux Kernel Manager and Activity Monitor ?? ?? The kernel is the part of the operating system that facilitates interactions between hardware and soft

Orhun Parmaksız 1.2k Jun 1, 2021
A command-line benchmarking tool

hyperfine 中文 A command-line benchmarking tool. Demo: Benchmarking fd and find: Features Statistical analysis across multiple runs. Support for arbitra

David Peter 7.9k Jun 6, 2021