Skip to content

A CLI translator based on the API from public area and Node.js

License

Notifications You must be signed in to change notification settings

plantree/node-translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-translator

License: MIT CI Travisnpm downloads

A CLI translator based on the API from public areas and Node.js.

Features

  • Interactive mode, auto language detection
  • Simple spelling correction
  • Based on the API from Baidu Translate (currently)
  • Only support English and Chinese (currently)

Install

npm install -g translator-me

Usage

There are two modes while using this translator.

  • CLI

    Usage: translator-me [options]
    
    Options:
      -v, --version        output the version number
      -i, --interactive    interactive mode
      -f, --from [value]   from language (default: "en")
      -t, --to [value]     to language (default: "zh")
      -q, --query <value>  query text
      -h, --help           display help for command
  • Interactive

    Interactive mode supports setting different destination language, and the source language is been automatically detected.

    • set en, means the destination language is English
    • set zh, means the destination language is Chinese
    • set auto, means that if the source language is English, the destination language will be Chinese, and vice versa.
    • q, means quit.

Demo

Reference

  1. https://www.ruanyifeng.com/blog/2015/05/command-line-with-node.html
  2. https://blog.csdn.net/guang_s/article/details/90380581
  3. https://zhuanlan.zhihu.com/p/37316872
  4. https://juejin.im/post/6844903709101522951

License

MIT @plantree

About

A CLI translator based on the API from public area and Node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published