Skip to content

Commit

Permalink
Translate Chinese manual introduction and title (#1220)
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcer committed Jun 9, 2022
1 parent 97fde19 commit 543264b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion bin/generate-book/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ impl Language {
Self::Chinese => ".中文",
}
}

fn introduction(&self) -> &'static str {
match self {
Self::Chinese => "说明",
Self::English => "Introduction",
}
}
}

fn main() -> Result<(), Box<dyn Error>> {
Expand All @@ -53,7 +60,7 @@ fn main() -> Result<(), Box<dyn Error>> {
cmark(chapter.iter(), &mut txt)?;
let title = if i == 0 {
txt = txt.split_inclusive('\n').skip(1).collect::<String>();
"Introduction"
language.introduction()
} else {
txt.lines().next().unwrap().split_once(' ').unwrap().1
};
Expand Down
2 changes: 1 addition & 1 deletion book/zh/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authors = ["Casey Rodarmor"]
language = "zh"
src = "src"
title = "Just Programmer's Manual"
title = "Just 用户指南"

[build]
build-dir = "../../www/man/zh"
2 changes: 1 addition & 1 deletion www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<a href="https://discord.gg/ezYScXR">discord</a>
<a href="https://crates.io/crates/just">crates.io</a>
<div></div>
<a href="man/zh/">手冊</a>
<a href="man/zh/">用户指南</a>
<div></div>
<div></div>
</body>
Expand Down

0 comments on commit 543264b

Please sign in to comment.