A Rust project for translating EPUB files using the DeepL API.
- Translate EPUB files directly to another language.
- Supports large file sizes without limitations.
- Highly concurrent translation, supporting up to 700 translation channels (DeepL API limitations).
- Allows the use of multiple API keys for high-volume translations.
First, build the project with cargo
:
cargo build --release
The executable will be located in the target/release directory. For a development build, you can use:
cargo build
The executable will then be in the target/debug directory.
Translate EPUB file with default values to target language:
epub-translator [OPTIONS] --target-lang <TARGET_LANG> <INPUT_FILE> <OUTPUT_FILE>
Run epub-translator --help
to get a detailed description of all available options.
Run the translation process using a mock server. This allows testing without using the DeepL API. The mock server will start automatically and terminate when the program ends.
epub-translator [OPTIONS] --test --target-lang <TARGET_LANG> <INPUT_FILE> <OUTPUT_FILE>
Example:
epub-translator --test --target-lang es book.epub translated_book.epub
Increase the number of concurrent translation channels using the -p option. Note that the DeepL API becomes unstable with more than 700 channels on the free-tier API. The default is set to 400.
Example, translate using 1000 concurrent channels:
epub-translator -p 1000 --target-lang es book.epub translated_book.epub
Debug logs are stored in a hidden file .epub-translator-logs located in the current working directory. If you encounter issues or need detailed information about the execution, you can review this file.
This project is licensed under the MIT License - see the LICENSE file for details.
This project uses the DeepL API for translations. Please ensure you comply with DeepL's terms of service when using this tool.
- EPUBCheck: https://github.com/w3c/epubcheck
- EPUB 3.3 Specs: https://www.w3.org/TR/epub-33/
- Docker image for EPUBCheck: https://hub.docker.com/repository/docker/carlosfy/epubcheck/general
Contributions are welcome! Feel free to open issues or submit pull requests.