Skip to content
Command-line access to google translate and some other features
Branch: master
Clone or download
Anoncheg1
Latest commit 066d47e Dec 30, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore gitignore Jun 12, 2018
LICENSE license Mar 17, 2018
README.md f2 Mar 17, 2018
perlfork.pl always sould off Jul 28, 2018
translate yandex transcription added Dec 30, 2018
urban.pl urban sock lib dependency commented May 27, 2017

README.md

Gitter chat

Google translate script. It gives you easy access to Google Translate in your terminal:

Installation step by step:

    1. download one of the version Perl (perlfork.pl) or Bash (translate and urban.pl)
    1. install requirements
    1. execute command: $ chmod +x perlfork.pl translate urban.pl
    1. add to ~/.bash_aliases: alias t="/home/user/perlfork.pl"
    1. (optional) edit options section in script perlfork.pl or translate for your taste (choose language detection scema)
$ t die unbekannten Sprache
	Language: German
	...
$ t -l
	de	German
$ alias tde="t -s de -t en"
$ tde "die unbekannten Sprache"
	the unknown language

https://github.com/Anoncheg1/Command-line-translator

Google translate shell, Google translate command-line, command-line translator Google Translate, Linux, easy to use, fast and comfortable. Command-line google translate, quick translate, very simple scripts, scripts for assess Google Translate, Google Translate CLI.

FILES:

  • perlfork.pl - Perl5 version. Google translate only.
  • translate - Bash version. Good for English dictionary.
  • urban.pl - optional plugin for bash version.

Perl version

get perl version:

$ wget http://git.io/vEUKU
$ chmod +x perlfork.pl

REQUIREMENTS:

  • perl5 >= v5.16
  • perl JSON
  • perl Clone
  • perl LWP::Protocol::socks -if you need socks proxy
  • mplayer or mpg123 -for sound

FEATURES:

  • Windows support(planned),
  • translated text,
  • fixed text with highlight,
  • language detection,
  • dictionary,
  • translit,
  • google text-to-speach

There is two systems for detection of direction($FIRST_LANG to $SECOND_LANG or vice versa):

  • Simple detection of direction. First it search Latin or Russian symbols and decide. If not found it use $source = 'auto'; $target = 'en';
  • Advanced detection of direction. ALD=1;

Bash version - extended support for english and german, urban dictionary

REQUIREMENTS:

  • UTF-8 support for required languages
  • curl >= 7.21.0
  • SpiderMonkey or nodejs
  • mpg123 for playing pronunciation For Debian sid: #apt-get install curl spidermonkey-bin html2text mpg123 For Debian jessie: #apt-get install curl nodejs html2text mpg123 For FreeBSD: #pkg install curl spidermonkey24 html2text mpg123
  • forvo.com account for pronunciation
  • optional: urban.pl, perl HTML-Tree (see URBAN_DICTIONARY)

FEATURES:

  • translated text,
  • fixed text with highlight,
  • language detection,
  • dictionary,
  • translit,
  • execution without parameters will translate fixed string for 1-2 words
  • prompt mode
  • requery with fixed

for english:

  • phrases, forms, ideom, transcription, audio pronunciation
  • cache for words
  • saving english words to file for learning
  • urban dictionary

for german:

  • transcription

for convenience. Add to ~/.bash_aliases:

  • alias t="/home/user/perlfork.pl"
  • alias ts="/home/user/translate -S"

Commands:

  • -s Source language (can be "auto")
  • -t Target language (can't be)
  • -l List of languages
  • -h Help

Examples:

  • t -s auto -t en 母亲
  • cat file | t -

Debian Cyrillic support in tty shell:

    1. #dpkg-reconfigure locales
  • Install en_US.utf8, ru_RU.utf8
    1. #dpkg-reconfigure console-setup
  • Install . Combined - latin slavic Cyrillic; Greek

command line google translate command-line translator linux debian gentoo fedora mint ubuntu text-based languages

You can’t perform that action at this time.