0.6.12 • Published 3 years ago

what-is-x v0.6.12

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

whats 🔍

一个作者本人也经常用的命令行翻译工具🤓

Inspired by afc163/fanyi, but more

npm.io npm.io npm.io npm.io

npm.io

⭐️Features

  • 中英日文基本词语互译
  • 小语种中文翻译
  • 支持语言范围内的长句翻译
  • 文本关键字高亮
  • 中英文语音播放
  • 终端自适应的输出
  • 支持查询记录

npm.io

💾Install

npm install -g what-is-x

🚨注意

💡Usage

Usage: whats <query> [options]

Options:
  -v, --vers                      output the current version
  -h, --help                      output usage information
  -f, --from        <source>      the source language to translate
  -t, --to          <target>      the target language
  -n, --normal                    normalize text color in your terminal
  -s, --say                       use default system voice and speak
  -r, --record   [limit | clear]  show the query record (limit records ouputs default: 6 or clear records)

Examples:
  $ whats love
  $ whats bonjour -f fr
  $ whats こんにちは -f ja -t en
  $ whats I love you very much
  $ whats -r clear // 清除查询记录
  $ whats -r 10    // 限制查询结果数量

🇨🇳支持语言

语言目标语言
中文英文、日文、韩文、法文、西班牙文、葡萄牙文、俄文、越南文、德文、阿拉伯文、印尼文、意大利文
英文中文、日文
日文中文、英文
韩文中文
法文中文
西班牙文中文
葡萄牙文中文
意大利文中文
俄文中文
越南文中文
德文中文
阿拉伯文中文
印尼文中文
意大利文中文

🇺🇳各语言对应代码

语言代码
中文zh-CHS
英文en
日文ja
韩文ko
法文fr
西班牙文es
葡萄牙文pt
意大利文it
俄文ru
越南文vi
德文de
阿拉伯文ar
印尼文id

💬Notes

  1. 你的 Node 版本需 ≥ 7.6.0

  2. 本翻译工具拥有终端自适应的输出,即超过终端宽度的输出会被切分并排版, 例句的输出不会溢出终端窗口。一般情况下想要看到全部的例句建议的终端窗口大小最少为 73 * 25

  3. 不要混用全角和半角符号,这会让程序难以判断句子的切分位置从而导致排版畸形的输出结果

  4. 测试版本目前支持基本词语的互译、小语种中文翻译、长句子翻译(中文字符数 > 4 将被视为句子)

  5. 输出结果的文本颜色可能会因你的终端主题而有较大差异, 想要消除颜色带来的影响(无颜色输出)可以使用 -n--normal 命令。 例如:

    $ whats up --normal
  6. 中英文互译外所有语言的翻译必须使用 -f--from 标识源语言

  7. 在支持语言范围内,若无 -t--to 命令标识,目标语言默认为中文
  8. 使用语音播放 -s--say 时,可能会存在系统层次的问题,具体参考👉say.js

🚨关于 v0.4.6 及以上版本说明

由于 MacOS 自 10.11 系统开始使用了 Rootless 机制,系统默认将会锁定 /system、/bin、/usr 这三个目录, 因此全局环境下无法获取数据库读写权限,需要在终端输入如下命令:

sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}

📄License

MIT.

0.6.12

3 years ago

0.6.11

3 years ago

0.6.10

4 years ago

0.6.9

4 years ago

0.6.8

4 years ago

0.5.8

4 years ago

0.5.7

4 years ago

0.4.7

4 years ago

0.4.6

5 years ago

0.3.6

5 years ago

0.3.5

5 years ago

0.2.5

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago