Skip to content
/ t Public

Japanese <-> English translate in terminal

License

Notifications You must be signed in to change notification settings

unblee/t

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

t

Japanese <-> English translate in terminal

Require

Use Watson Language Translator

  • Service credentials
    • username (different from your Bluemix account)
      • export T_WATSON_LANGUAGE_TRANSLATOR_API_USERNAME=<Your Watson Language Translator API username>
    • password (different from your Bluemix account)
      • export T_WATSON_LANGUAGE_TRANSLATOR_API_PASSWORD=<Your Watson Language Translator API password>

Install

You can download binary from release page and place it in $PATH directory.

Usage

t [input text]

or

echo [input text] | t

  option:
    -v --version: show version

  t translates input text specified by argument or STDIN using Watson Language Translation API.
  Source language will be automatically detected.

  export T_WATSON_LANGUAGE_TRANSLATOR_API_USERNAME=<Your Watson Language Translator API username>
  export T_WATSON_LANGUAGE_TRANSLATOR_API_PASSWORD=<Your Watson Language Translator API password>

  Example:
    $ t Good morning!
    おはようございます!
    $ t おはようございます!
    Good morning!

Note

  • No available in mintty 😭 (isatty() not working)
  • The text must be the UTF-8 when using a pipe input
    • exec echo "UTF-8 text" | t

Supported

Todo

Development

Require

  • unix shell(e.g. bash, zsh)
    • msys2 on windows (or WSL)
  • golang >= 1.7
  • make
  • glide
  • docker
  • editor/IDE with editorconfig plugin
  • github token

Reference

Many thanks!