Translate Book

Translates a whole PDF, Word or EPUB book into another language chunk by chunk, keeps names consistent, and rebuilds it as an ebook.

Writing & Editingtranslationebookspdfepubby deusyu2.3kGitHub

What it is

A book translation tool for readers, students, researchers and small publishers who want a full translation of a long book rather than a few pages at a time. You point it at a PDF, Word (DOCX), EPUB or Markdown file and name a target language. Chinese is the default, and languages such as English, Japanese, Korean, French, German and Spanish are supported. It returns the translated book as a web page with a floating table of contents, plus DOCX, EPUB and PDF versions.

Asking an AI to translate a whole book in one chat tends to lead to skipped or cut-off sections. This skill splits the book into small chunks and hands each one to a separate sub-agent with a fresh memory, eight at a time by default. A shared glossary keeps the names of people, places and key terms the same throughout, and each translator sees a short excerpt from the neighboring chunks to get pronouns and genders right. Scripts check that every chunk is translated before anything is merged.

Runs can be interrupted and resumed, and after the build you can fix or re-translate single chunks without redoing the whole book. For PDFs with formulas, tables or multiple columns, plain conversion can scramble the layout, so it can use a layout-aware tool such as MinerU or Marker first if you have one installed. A full book means many sub-agent runs, which takes time and uses a large share of your agent's usage.

What it can do

  • Converts PDF, DOCX, EPUB or Markdown into numbered chunks, dropping page-number lines from PDFs.
  • Builds a glossary of names and recurring terms and gives each translator the terms its chunk needs.
  • Translates chunks in parallel batches, eight sub-agents at a time by default, each with a fresh context.
  • Keeps headings, images, tables, footnotes and math formulas intact while translating only the text.
  • Feeds new names that translators spot back into the glossary and settles conflicting translations.
  • Checks every chunk has a translation, retries failures and picks up interrupted runs where they stopped.
  • Outputs HTML with a floating table of contents plus DOCX, EPUB and PDF, with a translated book title.

When to use it

  • You bought an English nonfiction book as an EPUB and want to read it in Chinese.
  • Your research group needs a working Japanese translation of a long technical manual in PDF.
  • You are a small publisher checking whether a foreign novel is worth commissioning a human translation for.
  • You translated a book last week, noticed a character's name came out wrong, and want it fixed everywhere.

How it works

  1. 1Collects the file, target language and any instructions, then runs a script that uses Calibre to convert the book and split it into chunks.
  2. 2Samples a few chunks to build a glossary of names and terms, and counts how often each one appears.
  3. 3Works out which chunks need translating and sends each to its own sub-agent with the relevant glossary terms and neighbor excerpts.
  4. 4After each batch, records progress and merges new terms the translators found into the glossary.
  5. 5Verifies every chunk is done, retries missing ones and translates the book title.
  6. 6Runs a build script that merges the chunks and uses Pandoc and Calibre to produce HTML, DOCX, EPUB and PDF.

Try asking

“Translate /path/to/book.pdf to Chinese.”
“Translate this EPUB into Japanese and keep the character names consistent: ~/Books/novel.epub”
“Translate my-thesis.docx into English, using formal academic wording.”
“The main character's name is wrong in the translated book. Fix it everywhere and rebuild.”

How to install

Install with the skills CLI (recommended)

Works with Claude Code, Codex, Cursor, OpenCode and other agents, and asks which ones to install to. Needs Node.js 22.20+. Add -g to make it available in every project.

npm
npx skills add deusyu/translate-book
pnpm
pnpm dlx skills add deusyu/translate-book

Install manually

Copies the skill folder into Claude Code's personal skills directory. For claude.ai, zip the translate-book folder and upload it in the Skills section of Settings.

Terminal
git clone --depth 1 https://github.com/deusyu/translate-book.git ~/.claude/skills/translate-book

Then just ask in plain language, for example: “Translate /path/to/book.pdf to Chinese.”