Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/axetroy/translate-cli

A cli tool for translate text in terminal.
https://github.com/axetroy/translate-cli

cli cli-app nodejs translate

Last synced: about 1 month ago
JSON representation

A cli tool for translate text in terminal.

Awesome Lists containing this project

README

        

## translate-cli

[![Greenkeeper badge](https://badges.greenkeeper.io/axetroy/translate-cli.svg)](https://greenkeeper.io/)

A cli tool for translate text in terminal.

Use Baidu Translate API.

### Installation

```bash
npm install @axetroy/translate-cli -g
```

### Usage

```
$ translate -h

Usage: translate [content] [options]

Options:

-h, --help output usage information
-V, --version output the version number
-f, --from From Language, short locale name, like: en,zh,jp
-t, --to To Language, short locale name, like: en,zh,jp
```

```bash
$ translate
# translate REPL, will translate automatically, just need you type word then [Enter]

$ translate 你好世界
# output >>> Hello world

# or you can reverse it

$ translate Hello world
# output >>> 你好世界

# or you can use stream pipe

$ cat ./test
# output >>> Hello world
$ cat ./test | translate
# output >>> 你好世界
```

### Contribute

```bash
$ git clone https://github.com/axetroy/translate-cli.git
$ cd ./translate-cli
$ yarn
$ ./bin/translate-cli hello world
```

You can flow [Contribute Guide](https://github.com/axetroy/translate-cli/blob/master/contributing.md)

## License

The [MIT License](https://github.com/axetroy/translate-cli/blob/master/LICENSE)