Skip to content

Latest commit

 

History

History
103 lines (85 loc) · 2.78 KB

README_EN.md

File metadata and controls

103 lines (85 loc) · 2.78 KB
            ____
           / __/_  __
          / /_/ / / /
         / __/ /_/ /
        /_/  \__, /
            /____/

中文 | English

Release Build Status Go Report Card GoDoc DUB

fy is a command-line tool for translation.

Statement

This project is written for learning purposes only, the act of acquiring and sharing may be suspected of violating rights. please understand the situation, if your rights and interests are infringed, please contact me and I will delete it in time.

Installation

Homebrew

brew tap xwjdsh/tap
brew install xwjdsh/tap/fy

Go

go get -u github.com/xwjdsh/fy/cmd/fy

Docker

alias fy='docker run -t --rm wendellsun/fy'

Manual

Download it from releases, and extact it to your PATH directory.

Usage

Usage of ./fy:
  -d    Debug mode, if an error occurs during translation, the error message will be displayed as the translation result
  -f string
        File path
  -s    Display translator sources
  -t string
        The target language of the translation
  -timeout duration
        The timeout for each translator (default 5s)
  -translator string
        Restrict the translators used, comma separated. eg 'baidu,google'

Language Mapping

Shorthand Language
zh-CN Chinese
en English
ru Russian
ja Japanese
de German
fr French
ko Korean
es Spanish

Example

# display supported translators
fy -s

# if there are no params, the clipboard will be accessed
fy

# simplest
fy test

# debug mode
fy -d test

# specify the language
fy -t ja 测试翻译为日语

# target language for Chinese,default is English
FY_CN_TO=ko fy 翻译为韩语

# target language for Non-Chinese,default is simplified Chinese
FY_NOT_CN_TO=en fy 중국어로 번역

# for file
cat `test.txt` | fy
fy < test.txt
fy -f test.txt

# select only the translators
fy -translator 'baidu,google' test

Licence

MIT License