git clone https://github.com/zaiic/trans-cli-rs.git
cd trans-cli-rs
cargo build --release
sudo cp target/release/trans /usr/bin
trans 'hello world'
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.