explaingit

yisan0429/itranslation

Analysis updated 2026-05-18

17PythonAudience · generalComplexity · 2/5LicenseSetup · moderate

TLDR

A command-line tool that translates whole books into Chinese with AI, using overlapping chunks to avoid cutting sentences mid-thought.

Mindmap

mindmap
  root((Itranslation))
    What it does
      Translate books to Chinese
      PDF EPUB text markdown
      Command line only
    Key technique
      Sentence boundary splitting
      Overlapping chunks
      Term consistency checks
    Translation backend
      DeepSeek API
      OpenAI compatible APIs
      Local models
    Extraction
      PyMuPDF basic mode
      Marker AI mode
      EPUB near 100 percent

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Translate a full novel or nonfiction book from English into Chinese while keeping terminology consistent.

USE CASE 2

Convert a PDF or EPUB book into a translated version in the same file format.

USE CASE 3

Estimate translation cost in dollars and yuan before committing to a full book run.

What is it built with?

PythonPyMuPDFDeepSeek API

How does it compare?

yisan0429/itranslation0petru/sentimoalingalingling/akasha-wechat
Stars171717
LanguagePythonPythonPython
Setup difficultymoderatemoderatehard
Complexity2/53/54/5
Audiencegeneraldeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires a DeepSeek API key or another OpenAI-compatible endpoint to run.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

Itranslation is a command-line tool for translating entire books into Chinese using AI language models. It accepts PDF, EPUB, plain text, and Markdown files and produces translated output in those same formats. The current release (1.1.4) is command-line only, a desktop graphical interface existed previously but is temporarily unavailable while a threading bug is being fixed. The tool's main selling point compared to simpler approaches is how it handles long texts. Rather than cutting a book into fixed-size blocks of lines, it splits at sentence boundaries and creates overlapping chunks where each chunk shares a few sentences with the next one. This prevents a sentence from being cut in half mid-thought. When assembling the final output, it keeps only the first occurrence of each overlapping sentence and discards the duplicates, so the result reads cleanly. During translation, the tool tracks how each specialized term is being translated across the whole document and checks periodically whether the same term is being rendered consistently. If a term's translation has drifted below 80% consistency, it raises an alert. Translation is done through the DeepSeek AI API (with two pricing tiers: a higher-quality Pro model and a faster Flash model), or through any API that uses the same interface as OpenAI's, including locally hosted models. The tool shows real-time cost estimates per chunk and tracks total spending in both dollars and Chinese yuan. For a 100,000-word novel, the estimated cost on the Pro model is around $0.20. For PDFs specifically, the tool supports two extraction methods: a basic one using PyMuPDF that handles standard single-column layouts with around 60-70% accuracy, and an optional higher-quality method using a downloadable AI model called Marker that reaches 90% accuracy on complex layouts like multi-column pages and tables. EPUB files extract at close to 100% accuracy. The tool translates chapters in parallel using multiple worker threads (four by default) and saves progress after each chapter, so an interrupted translation can be resumed from where it stopped rather than starting over. It runs on Windows, macOS, and Linux with Python 3.11 or newer, and is released under the MIT license.

Copy-paste prompts

Prompt 1
Show me how to set up Itranslation with the DeepSeek API and translate a 100,000-word EPUB book into Chinese.
Prompt 2
Explain how Itranslation's overlapping chunk splitting prevents sentences from being cut in half during translation.
Prompt 3
How do I resume an interrupted Itranslation job partway through a long book?

Frequently asked questions

What is itranslation?

A command-line tool that translates whole books into Chinese with AI, using overlapping chunks to avoid cutting sentences mid-thought.

What language is itranslation written in?

Mainly Python. The stack also includes Python, PyMuPDF, DeepSeek API.

What license does itranslation use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is itranslation to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is itranslation for?

Mainly general.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.