A shell dictionary created by Rust.
Just download the binary file and put it into a directory which has been add to path.
- Visit rust-lang.org and select a suitable way to install Rust.
- Clone this repo and run
cargo build [--release].
Ensure you have add environmental variables listed in .env, and runslate can find .env file:
- Current directory.
- Executable file's directory.
- Application directory (~/.runslate/, usually).
# unix
source .env- The best way to use
runslateis put it into a dir contained byenv pathand rename it into a shorter name so you can lookup words more conveniently. And more, put.envinto that dir, too. - Type
runslate -hfor usage details, here are some options for example:-t, --translatorto select translator(API provider).-s, --source-langto set source language.-d, --target-langto set target language.-v, --verboseshow debug logs.- ...
runslateprovides someenv-varsfor configuration, in.env:- Use
RUNSLATE_TRANSLATORto pick translator. Available values: [youdao,google]. - Check env template file
.envfor more envs.
- Use
- How does
envwork?- First, runslate will try to read
.envin current directory, executable file directory, app directory(~/.runslate) one by one. If env file loading fails, program would exit. - Second, parse options:
- Some options are related to specified
env-vars, if they were found, use them first. - Use options' default values(if given).
- If there is not
env-varneither default value, an error is reported.
- Some options are related to specified
- As for some circumstances like env conflicting, not tested yet.
- First, runslate will try to read
- clap: parse arguments.
- tokio: async runtime.
- sea-orm: ORM.
- reqwest: http request.
- serde_json: json parse.
- env_logger: logging.
- dotenv: load env.
- 2025-12-03 v0.5.0 Add localized datasource, supplied by ECDICT, driven by sqlite.
- 2024-03-17 v0.4.4 It won't panic if .env file doesn't exist.
- 2023-08-15 v0.3.0 Load
.envfile from current dir, app-dir(~/.config/runslate/), exe-file dir one by one. - 2023-08-15 v0.2.0 Save & load cache.
- v0.1.0 Main function released which contains Youdao and google api.