epub-translator
epub-translator copied to clipboard
A tool for translating epub files to different languages using the Google Translate, with support for custom dictionaries.
epub-translator
A tool for translating epub files to different languages using the Google Translate, with support for custom dictionaries.
Download
·
Screenshots
·
Script Usage
Table of Contents
- Table of Contents
- About The Project
- Features
- Getting Started
- Custom Dictionary Usage
- Prerequisites
- Script Usage
- Notes
- Screenshots
- Issues
- Contributing
- License
- Contact
About The Project
A tool for translating epub files to different languages using the Google Translate, with support for custom dictionaries.
Features
- Autodetect source languages and support multiple destination languages.
- Keeping the structure of the original epub file (images, table of contents, text style,...)
- Support custom translation dictionaries (after translated).
- Support multiprocessing to speed up.
- Auto checking the new tool version.
Getting Started
Download the execution file below. Run and follow the instructions.
Windows: epub-translator.exe ~ 12MB
Custom Dictionary Usage
The custom dictionary will replace the original translated text by Google Translate with your own text.
- The custom dictionary is a
.txtfile with line by line in the format:
[original_translated_text]:[your_translated_text] - Text is case sensitive with special characters (except colon) and spaces are are allowed, separated from the other by the single colon
:.
Prerequisites
- python3
- google_trans_new
- requests
- bs4
- lxml
- tqdm
pip install google_trans_new requests bs4 lxml tqdm
or
pip install -r requirements.txt
Important
- To deal with the
json.decoder.JSONDecodeError: https://github.com/lushan88a/google_trans_new/issues/36
Script Usage
usage: epub-translator.py [-h] [-v] [-l dest_lang] [-d dict_path] epub_file_path
A tool for translating epub files to different languages
using the Google Translate, with support for custom dictionaries.
positional arguments:
epub_file_path path to the epub file
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-l dest_lang, --lang dest_lang
destination language
-d dict_path, --dict dict_path
path to the translation dictionary
Notes
- The translated epub file will be named
[original_file]_translated.epuband located in the same folder as the original epub file. - Suported destination languages are shown in
LANGUAGESvariable in theepub-translator.pyfile. - This tool uses autodetect source languages when translating. If you have a problem with it, contact me and maybe I will add the manual select source languages.
Screenshots

Issues
- I only tested the tool on some of my favorite books and light novels.
- This tool may be buggy. Some books may crash with complex epub structure or some of the text will not be translated.
- Sometimes, too many translation requests to the Google Translate may cause Google to ban your IP from getting its translation service shortly. If this happens, you should change your IP via VPN.
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE for more information.
Contact
- Author - @quantrancse