yihong0618/bilingual_book_maker
Make bilingual epub books Using AI translate
What it solves
Reading a book in a foreign language is hard. This tool automates the creation of side-by-side bilingual versions of e-books, so you can compare the original and a machine translation without leaving your reader. It works on epub, txt, md, srt, and pdf files, and it supports many translation backends, from OpenAI and Anthropic to Google Translate and DeepL.
How it works
You give it a book file and an API key (or a configured provider). It sends the text to a chosen translation endpoint, receives the translated version, and produces a new file with both languages side by side — for example, book_bilingual.epub or book_bilingual.txt. The tool can run in session mode to keep translation context consistent (so recurring names stay the same across the book), and it can also be told to classify which HTML tags to translate in EPUBs (plan mode) instead of blindly translating every paragraph. If a run is interrupted, it writes a temporary bilingual file that you can rename to keep partial progress.
Who it’s for
Anyone who owns the rights to a book (public domain, their own work, or properly licensed material) and wants a bilingual version for study, appreciation, or sharing. It is a command-line tool, so it suits users comfortable with a terminal and managing API keys. Developers can also use its custom provider JSON to plug in any OpenAI-compatible or Anthropic-format API.
Highlights
- Input formats: epub, txt, md, srt, pdf (outputs bilingual epubs for epubs, and txt/md/srt for those inputs; PDFs get a txt fallback and an attempted epub)
- Translation endpoints: OpenAI, Anthropic, Google, DeepL (paid and free), Gemini, Qwen-MT, Groq, xAI, Tencent TranSmart, Caiyun, LiteLLM, Ollama, Codex, and any custom OpenAI/Anthropic-compatible API via a JSON config
- Session mode with automatic history compaction, glossary learning, and consistent naming across the book
- Plan mode for EPUBs: classifies which tags really need translation, using the model itself or an external agent; dry-run option to preview the plan
- Optional cost tracking: if you list per-model prices, the progress bar shows money spent instead of token counts
- Resume flag to pick up after an interruption without retranslating everything
- Test mode to translate just the first few paragraphs before paying for a full run
Related
- Project
- Project
- Project
- Project
- Project