A command-line translation tool written in Rust that supports automatic language detection and multi-language translation. Based on Google Translate API.
- No API key required
- Automatic language detection
- Support for 100+ languages
git clone https://github.com/yourusername/translate.git
cd translate
cargo install --path .# English to Chinese
translate "Hello, World!"
> 你好,世界!
# Chinese to English
translate "你好,世界!"
> Hello, World!
# Japanese to Chinese
translate --source ja --target zh-CN "こんにちは世界"
> 你好世界
# Auto-detect to German
translate --target de "Hello World"
> Hallo WeltOptions:
-s, --source <SOURCE> Source language (default: auto)
-t, --target <TARGET> Target language (default: auto)
-l, --list Show supported languages
-h, --help Show help information
-V, --version Show version information
auto- Auto detecten- Englishzh-CN- Chinese Simplifiedja- Japaneseko- Koreanfr- Frenchde- German
Use translate --list to see the complete language list.
- This tool uses an unofficial Google Translate API and may have stability issues
- To avoid IP restrictions, please control request frequency
- Some languages may require specific character encoding support
- Auto-detection may not always be 100% accurate
Issues and Pull Requests are welcome!
- Google Translate API
- clap-rs - Command line argument parser
- reqwest - HTTP Client
- alfred-translate-workflow
MIT