Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/liuxing/translator-cli

The command line app for translate.
https://github.com/liuxing/translator-cli

cli fanyi translation

Last synced: about 2 months ago
JSON representation

The command line app for translate.

Awesome Lists containing this project

README

        

# translator-cli

[![Travis](https://www.travis-ci.org/liuxing/translator-cli.svg?branch=master)](https://www.travis-ci.org/liuxing/translator-cli) [![npm version](https://img.shields.io/npm/v/translator-cli.svg)](https://www.npmjs.com/package/translator-cli) [![npm downloads](https://img.shields.io/npm/dm/translator-cli.svg)](https://www.npmjs.com/package/translator-cli) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

> The command line app for translate

## Install

```bash
$ npm install -g translator-cli
```

## Features

- translates words, phrases between English and Chinese
- easy and fast switch between different API (e.g. youdao、iciba)

## Usage

```bash
$ translator

Usage: translator [options] [command]

Options:

-V, --version output the version number
-h, --help output usage information

Commands:

* Query words
query|q Query words
ls List all the source
use Change source to source
```

Of course, you can also use `fanyi` or `fy ` like:

```bash
$ fanyi
# ···
# or
$ fy
# ...
```

### Query words
```bash
$ fy
# e.g.
$ fy test # or: fy query test、fy q test
test [ test ] ~ fanyi.youdao.com

- n. 试验;检验
- vt. 试验;测试
- vi. 试验;测试
- n. (Test)人名;(英)特斯特

1. Test
测试,测验,检验

2. Test Drive
Test Drive,Test Drive,无限狂飙

3. Test Engineer
测试员,测试工程师,软件测试工程师
```

### Change source

List all the source
```bash
$ fy ls
* youdao -> http://fanyi.youdao.com
iciba -> http://dict-co.iciba.com
```

Change source to source
```bash
$ fy use iciba
source has been set to: iciba
```

## LICENSE
[MIT](https://github.com/liuxing/translator-cli/blob/master/LICENSE) @ Liu Xing