/trans-cli-rs

Command line translation utility writen by Rust.

Primary LanguageRust

Trans-cli-rs

Install

From Source

git clone https://github.com/zaiic/trans-cli-rs.git
cd trans-cli-rs
cargo build --release
sudo cp target/release/trans /usr/bin

Usage

trans 'hello world'

Config

Create a config file in ~/.config/trans-cli-rs/config.toml and add the following code:

#config.toml
[basic]
backend = "default"
from = "en"
to = "zh"

[key]
appid = "appid_123"
secret_key = "key_123"

The default backend is Baidu Translation. The appid and the secret_key can be acquired on this site.