Giter VIP home page Giter VIP logo

gtranslate's Introduction

gtranslate

NPM Version node Dependency Status JavaScript Style Guide Patreon donate button

Node.js Google translate CLI tool!

Install

$ npm install -g gtranslate

NPM

Usage

  1. Register and setup a new API key from the Google Cloud.

  2. type gtranslate register <API_KEY> with your APIKEY:

Heads Up! The API_KEY is stored in your home directory in a file called .gtranslate

  1. That's it!

Common usage

Register a new API_KEY:

$ gtranslate -r <API_KEY>

Translate with language autodetect and default target language:

$ gtranslate <text>

Basic translation (with source language autodetect):

$ gtranslate -t en <text>

Provide the --source (-s) language:

$ gtranslate -s it -t en <text>

Set a default target language:

$ gtranslate --set-target it

(By default EN is the default target language)

Available options

--register OR -r     Set a new Google Translate API KEY
--source OR -s     Provide the source language
--target OR -t     Provide the target language
--set-target OR -st     Set a default target language [EN by default]

Build

Clone this repository to your local folder, then link it to enable you to use the command line tool from your source folder using npm link.

Then you can simply call gtranslate -t it -s en "really cool".

Don't forget to register your api key before using it as well.

Tests are written in mocha and run by npm test or npm run test-watch.

Author

Rocco Musolino (@roccomuso)

gtranslate's People

Contributors

ddikman avatar dependabot[bot] avatar roccomuso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gtranslate's Issues

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.