Giter Site home page Giter Site logo

cli-translate's Introduction

cli-translate

This is a script for getting quick translation and pronounciation.

To install:

  • copy the translate_to file into /usr/local/sbin or somewhere on the path
  • mark it as executable

To use:

$ translate_to <lang code> <phrase or phrases>

What this does:

  • speaks the result
  • prints a full translation
  • prints a brief translation (at the bottom, for quickly reading)
  • unless the "to" language in English, reverse looks it up (into english) and prints that.

Example:

whole phrases - does a single lookup to Google translate. The whole phrase is between quotes.

max@max ~> translate_to zh "chinese is known for being difficult to translate back and forth between english"
chinese is known for being difficult to translate back and forth between english

**人很难在英语之间来回翻译
(Zhōngguó rén hěn nán zài yīngyǔ zhī jiān láihuí fānyì)

Translations of chinese is known for being difficult to translate back and forth between english
[ English -> 简体中文 ]

chinese is known for being difficult to translate back and forth between english
    **人很难在英语之间来回翻译, **被称为是很难翻译来回英语之间
**人很难在英语之间来回翻译

reverse translation: 
It is difficult for Chinese people to translate back and forth between English

segmented phrase - no quotes surround the phrase, so each word triggers a new lookup

max@max ~> translate_to de this is an apple
this
/T͟His/

Dies

Definitions of this
[ English -> Deutsch ]

pronoun
    dieses
        this
    dieser
        this
    diese
        this, these
    dies
        this
    das
        that, this, it, who
is

Ist

Translations of is
[ English -> Deutsch ]

is
    Ist
an
/an/

ein

Definitions of an
[ English -> Deutsch ]

article
    eine
        a, an
    ein
        a, an
apple
/ˈapəl/

Apfel

Definitions of apple
[ English -> Deutsch ]

noun
    (der) Apfel
        apple
Dies
Ist
ein
Apfel

reverse translation: 
This Is An Apple

cli-translate's People

Contributors

maxpleaner avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.