Open-source project
KaiserY/trpl-zh-cn avatar
KaiserY/trpl-zh-cn

KaiserY/trpl-zh-cn: the Simplified Chinese translation of the Rust Book, 2024 edition

Rust 程序设计语言(2024 edition 施工完毕)

5,630 stars733 forksMarkdownMIT

At a glance

What is it?
This is a translation repository, not a library. It mirrors the source of the official Rust Book as Markdown, builds to HTML with mdBook, and ships a Rust tool that turns the book into an EPUB. Here is what it is good for, and where it stops being the right choice.
Who is it for?
Adopt trpl-zh-cn if you need to read or host the Rust Book in Simplified Chinese, or if you want a PDF and EPUB of it without touching the English source. Do not adopt it expecting an API, a runtime dependency, or a library to import; it produces documents.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 39 days ago.
What is it written in?
Mainly Markdown, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.

Editorial analysis

A translation of the Rust Book, not a Rust library

The repository holds the Simplified Chinese text of the Rust Book, 2024 edition. The README states that the 2024 edition is finished, which matters because the book has been revised across editions and a half-translated edition is worse than an obviously incomplete one. The audience is Chinese-speaking readers learning Rust and the people who host reading material for them: course authors, community site maintainers, and anyone who wants a local copy of the book rather than a browser tab pointed at a hosted site.

The unit of work here is prose. There is no crate to depend on, no API surface, and no runtime behaviour to reason about. If you are looking for something to put in Cargo.toml, this is the wrong repository. If you are looking for a book you can build, search, and print, it is the right one.

How the translation stays traceable to the upstream source

The README names the reference source directly: the Rust Book lives at rust-lang/book under the src directory, and each translated chapter opens with a comment carrying the official link and a commit hash. That comment is the mechanism that makes drift visible. When the upstream chapter changes, the hash in the translated file no longer matches the upstream commit, and a reader or contributor can see that the Chinese text was written against an older revision.

The README also warns that the src directory is generally newer than the rendered book at doc.rust-lang.org/book, and that when the two disagree you should follow src. That is a deliberate choice to track the moving source rather than the published site, and it means a discrepancy between this translation and the website is not automatically a translation bug. The repository accepts issues and pull requests for cases where the translation and the official text diverge.

One more detail about the process: the README says part of the chapters were proofread with Codex assistance, and it points to proofreading_prompt.md for the prompt used. That file is in the repository root, so the method is inspectable rather than asserted.

Installing mdbook and building the HTML locally

The book is an mdBook project. The README instructs you to install Rust first, then install mdbook globally with Cargo.

bash
cargo install mdbook

From the project directory, the README gives two commands. The first produces static pages under ./book/html.

bash
mdbook build

The second starts a local HTTP server so you can read the result in a browser while you work.

bash
mdbook serve

The repository root contains book.toml, which is where mdBook reads its configuration, along with theme/, ferris.css and ferris.js for the rendering. If you only want to read the book, the homepage at kaisery.github.io/trpl-zh-cn is the shorter path; building locally is for people who want to edit, host, or diff the text.

Generating the PDF and the EPUB

Two non-HTML outputs are documented. The PDF is linked from the README and the README states it is produced with mdbook-typst-pdf, a separate project by the same author; the typst topic on the repository and the custom-template.typ file in the root are consistent with that pipeline. There is no documented command in the README for regenerating the PDF yourself, only the link to the finished file and an invitation to open issues or pull requests against the generator.

The EPUB path is different: it is a Rust program inside this repository. The README requires Pandoc to be installed on your system, then gives this command from the project root.

bash
cargo run --release --manifest-path epub-builder/Cargo.toml

On success the README says the build writes rust_programming_language.epub into the repository root, and that file is present in the top-level listing. Note the asymmetry: EPUB is reproducible from this repository, PDF is not documented as reproducible here.

Where the project is thinner than it looks

The README advertises GitBook support alongside mdBook, and then qualifies it: some functionality is missing, and it gives syntax highlighting in code blocks as an example. So the GitBook route is a degraded rendering, not an equivalent one. If your publishing setup is GitBook-based, expect code samples to render without highlighting, and treat that as a known gap rather than a bug to report.

The README also lists community resources with a stale edge: the first QQ group is described as full and invitation-only, with a second group number given. Contact channels rot faster than code, and this is a translation project where the channel is the support model.

Finally, there are no retrieved releases. Updates arrive as commits to Markdown files, so there is no version number to pin against and no changelog to read. The last push was on 2026-08-22, which is recent, but recency of the last commit is not the same as a release cadence, and nothing in the repository publishes one.

When to read the English book instead

The obvious alternative is the official English text at doc.rust-lang.org/book, and the difference is not just language. The English site is rendered from rust-lang/book and is the canonical artifact; this repository is a downstream translation whose README explicitly says the upstream src may be ahead of the rendered site. If you are chasing a recent change to the book, or you need to quote the exact current wording in a citation, the English source is the authority and this repository is a snapshot with a commit hash attached.

A second alternative is reading the hosted Chinese site rather than building anything. That trades control for zero setup. The build path in this repository exists for people who need the files, not for people who need the text.

Licence and the cost of keeping up

The repository is MIT licensed, and LICENSE sits in the root. MIT is permissive, so redistributing the translated Markdown, the built HTML, or the EPUB is not the obstacle. The thing to keep in mind is that the upstream Rust Book has its own licensing, and the README does not restate it; if you republish this translation commercially, check the upstream terms as well rather than assuming this repository's MIT file settles the question. That is a factual gap, not legal advice.

Maintenance cost falls mostly on whoever tracks upstream. There is no release artifact to upgrade and no dependency to bump, so the cost is editorial: when a chapter's upstream commit moves, someone has to re-read the Chinese text against it. The commit hash comments make that work findable, which is the main thing a translation repository can do to keep itself honest.

Editorial conclusion

Adopt trpl-zh-cn if you need to read or host the Rust Book in Simplified Chinese, or if you want a PDF and EPUB of it without touching the English source. Do not adopt it expecting an API, a runtime dependency, or a library to import; it produces documents. Before you rely on a chapter, check the commit hash comment at the top of that chapter's file and compare it with the corresponding file under rust-lang/book's src directory, because the README states that src is generally newer than doc.rust-lang.org/book and that conflicts should be resolved against src. Verify that mdbook is installed and that mdbook build writes into ./book/html before you wire the output into any publishing pipeline.

Frequently asked questions

Is trpl-zh-cn a Rust library I can add as a dependency?

No. It is the Simplified Chinese translation of the Rust Book, 2024 edition, stored as Markdown and built into static pages with mdBook. There is no crate to depend on.

How do I build the trpl-zh-cn book as static HTML?

Install mdbook with cargo install mdbook, then run mdbook build in the project directory. The README states the built pages appear in ./book/html, and mdbook serve starts a local HTTP server for reading them.

Can I get trpl-zh-cn as an EPUB or PDF?

The README links a finished PDF and says it was produced with mdbook-typst-pdf, but gives no command to regenerate it here. For EPUB, the repository contains a Rust builder: with Pandoc installed, cargo run --release --manifest-path epub-builder/Cargo.toml writes rust_programming_language.epub into the root.

Which Rust edition does trpl-zh-cn cover?

The README states the 2024 edition is finished. Each translated chapter opens with a comment carrying the official link and a commit hash for the upstream chapter it was based on.

Is Rust compiled or interpreted?

The repository is a translation of the Rust Book and its README does not discuss the language's execution model, so this question is outside what the material covers.

Official sources

  1. Issues
  2. KaiserY/trpl-zh-cn on GitHub
  3. License: MIT
  4. Project website
  5. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/kaisery-trpl-zh-cn.svg)](https://hysenlabs.com/projects/kaisery-trpl-zh-cn)