From 543264b2f05646e8f8a1d88a3d29459241078339 Mon Sep 17 00:00:00 2001 From: Justin Ma Date: Thu, 9 Jun 2022 12:48:44 +0800 Subject: [PATCH] Translate Chinese manual introduction and title (#1220) --- bin/generate-book/src/main.rs | 9 ++++++++- book/zh/book.toml | 2 +- www/index.html | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/generate-book/src/main.rs b/bin/generate-book/src/main.rs index 645f26c..54a40d6 100644 --- a/bin/generate-book/src/main.rs +++ b/bin/generate-book/src/main.rs @@ -27,6 +27,13 @@ impl Language { Self::Chinese => ".中文", } } + + fn introduction(&self) -> &'static str { + match self { + Self::Chinese => "说明", + Self::English => "Introduction", + } + } } fn main() -> Result<(), Box> { @@ -53,7 +60,7 @@ fn main() -> Result<(), Box> { cmark(chapter.iter(), &mut txt)?; let title = if i == 0 { txt = txt.split_inclusive('\n').skip(1).collect::(); - "Introduction" + language.introduction() } else { txt.lines().next().unwrap().split_once(' ').unwrap().1 }; diff --git a/book/zh/book.toml b/book/zh/book.toml index e0d677e..9ba38d8 100644 --- a/book/zh/book.toml +++ b/book/zh/book.toml @@ -2,7 +2,7 @@ authors = ["Casey Rodarmor"] language = "zh" src = "src" -title = "Just Programmer's Manual" +title = "Just 用户指南" [build] build-dir = "../../www/man/zh" diff --git a/www/index.html b/www/index.html index a8be532..2dfa4ff 100644 --- a/www/index.html +++ b/www/index.html @@ -16,7 +16,7 @@ discord crates.io
- 手冊 + 用户指南