1
1
mirror of https://github.com/casey/just.git synced 2024-11-23 02:44:56 +03:00

Translate Chinese manual introduction and title (#1220)

This commit is contained in:
Justin Ma 2022-06-09 12:48:44 +08:00 committed by GitHub
parent 97fde19a93
commit 543264b2f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

View File

@ -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>> {
@ -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
};

View File

@ -2,7 +2,7 @@
authors = ["Casey Rodarmor"]
language = "zh"
src = "src"
title = "Just Programmer's Manual"
title = "Just 用户指南"
[build]
build-dir = "../../www/man/zh"

View File

@ -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>