# zytranslate

> 翻译

Latest version **1.0.2** (published 2021-06-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install zytranslate
pnpm add zytranslate
yarn add zytranslate
bun add zytranslate
```

Provides the commands `fy`, `fanyi`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-06-16 |
| First published | 2021-06-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.0.0 |
| Dependencies | 9 |
| Unpacked size | 14.1 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | zhangyi99 |
| Keywords | translate, iciba, youdao, terminal, chinese, command line, cli, translation, fanyi |

## Links

- npm: https://www.npmjs.com/package/zytranslate
- npm.io page: https://npm.io/package/zytranslate

## Dependencies (9)

- [ora](https://npm.io/package/ora.md) ^4.0.2
- [say](https://npm.io/package/say.md) ^0.16.0
- [chalk](https://npm.io/package/chalk.md) ^4.0.0
- [xml2js](https://npm.io/package/xml2js.md) ^0.4.8
- [request](https://npm.io/package/request.md) ^2.81.0
- [commander](https://npm.io/package/commander.md) ^5.0.0
- [is-chinese](https://npm.io/package/is-chinese.md) ^1.2.5
- [html-entities](https://npm.io/package/html-entities.md) ^1.1.2
- [update-notifier](https://npm.io/package/update-notifier.md) ^4.1.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2021-06-16
- 1.0.1 — 2021-06-16
- 1.0.0 — 2021-06-16

## README

<div align="center">

# Fanyi

A 🇨🇳 and 🇺🇸 translate tool in your command line.

[![NPM version](https://img.shields.io/npm/v/fanyi.svg?style=flat-square)](https://npmjs.org/package/fanyi) [![Build Status](https://img.shields.io/travis/afc163/fanyi.svg?style=flat-square)](https://travis-ci.org/afc163/fanyi) [![NPM downloads](http://img.shields.io/npm/dm/fanyi.svg?style=flat-square)](https://npmjs.org/package/fanyi)

[![David Status](https://img.shields.io/david/afc163/fanyi.svg?style=flat-square)](https://david-dm.org/afc163/fanyi) [![devDependencies Status](https://david-dm.org/afc163/fanyi/dev-status.svg?style=flat-square)](https://david-dm.org/afc163/fanyi?type=dev) [![optionalDependencies Status](https://david-dm.org/afc163/fanyi/optional-status.svg?style=flat-square)](https://david-dm.org/afc163/fanyi?type=optional)

![](https://gw.alipayobjects.com/zos/rmsportal/EAuwmtfxDGueGOdUgVKc.png)

</div>

## Install

```bash
$ npm install zyfanyi -g
```

## Usage

```bash
$ fanyi word
```

For short:

```bash
$ fy word
```

Translation data is fetched from [iciba.com](http://iciba.com) and [fanyi.youdao.com](http://fanyi.youdao.com), and only support translation between Chinese and English.

In Mac/Linux bash, words will be pronounced by `say` command.

Translate one word.

```bash
$ fanyi love
```

```js
 love  [ lʌv ]  ~  fanyi.youdao.com

 - n. 恋爱；亲爱的；酷爱；喜爱的事物；爱情，爱意；疼爱；热爱；爱人，所爱之物
 - v. 爱，热爱；爱戴；赞美，称赞；喜爱；喜好；喜欢；爱慕
 - n. （英）洛夫（人名）


 love [ lʌv ] [ lʌv ]  ~  iciba.com

 - vt.&vi. 爱，热爱；爱戴；喜欢；赞美，称赞；
 - vt. 喜爱；喜好；喜欢；爱慕；
 - n. 爱情，爱意；疼爱；热爱；爱人，所爱之物；

```

More words.

```bash
$ zyfanyi make love
```

Support Chinese, even sentence.

```bash
$ zyfanyi 和谐
```

```bash
$ zyfanyi 子非鱼焉知鱼之乐
```

## Configuration

A configuration file can be put into ~/.fanyirc, in the user's home directory

Use subcommand `fanyi config [options]`

Example:

```bash
# Turn off the pronunciation
$ fanyi config --no-say
# or
$ fanyi config -S

# Disable the dictionaryapi
$ fanyi config --no-dictionaryapi
# or
$ fanyi config -D
```

A sample ~/.fanyirc file:

```json
{
  "iciba": true,
  "youdao": true,
  "dictionaryapi": false,
  "say": false,
  "color": true
}
```

## Error: spawn festival ENOENT

Try this workaround from [say.js](https://github.com/Marak/say.js#linux-notes) in Linux.

```
sudo apt-get install festival festvox-kallpc16k
```

---
_Source: https://npm.io/package/zytranslate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
