29 releases (18 stable)
Uses new Rust 2024
| 2.2.6 | Dec 21, 2025 |
|---|---|
| 2.2.5 | Nov 16, 2025 |
| 2.2.4 | Sep 14, 2025 |
| 1.4.2 | Aug 17, 2025 |
| 0.1.10 | Dec 16, 2024 |
#102 in Internationalization (i18n)
52KB
1K
SLoC
deeplx-rs
A Rust package for unlimited DeepL translation
Features
·
Usage
·
Integration
·
Reference
·
License
Features
- Docker support for easy deployment.
- Proxy support by default (can be disabled via features).
Usage
Docker Deployment
- Clone the repository:
git clone https://github.com/hominsu/deeplx-rs.git - Start the container:
cd deploy docker-compose up -d
Install with Cargo
cargo install
Integration
Installation
Add deeplx to your Cargo.toml:
[dependencies]
deeplx = { version = "2", default-features = false }
Configuration
deeplx is configured via the Config struct. You can specify options such as proxy, timeout, and more. For example:
use deeplx::{Config, DeepLX};
let translator = DeepLX::new(Config {
proxy: Some("http://pro.xy".to_string()),
..Default::default()
});
Or you can simply omit the proxy field:
use deeplx::{Config, DeepLX};
let translator = DeepLX::new(Config::default ());
Usage
Below is an example using tokio for async execution:
use deeplx::{Config, DeepLX};
#[tokio::main]
async fn main() {
let translator = DeepLX::new(Config {
proxy: Some("http://pro.xy".to_string()),
..Default::default()
});
// Or without proxy:
// let translator = DeepLX::new(Config::default());
match translator.translate("auto", "zh", "Hello, world!", None).await {
Ok(res) => println!("Translated: {}", res.data),
Err(e) => eprintln!("Error: {}", e),
}
}
Reference
License
Distributed under the MIT License. See LICENSE for more information.
Dependencies
~11–34MB
~541K SLoC