Skip to content

Commit 9a88e18

Browse files
authored
docs: update Simplified Chinese translation for 0.16.0 (#2155)
1 parent 2114f1e commit 9a88e18

File tree

16 files changed

+1919
-419
lines changed

16 files changed

+1919
-419
lines changed

docs/.vitepress/sidebars.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,13 @@ const zh_hans = [
457457
text: "指导",
458458
collapsed: false,
459459
items: [
460-
{ text: "什么是asdf?", link: "/zh-hans/guide/introduction" },
460+
{ text: "什么是 asdf?", link: "/zh-hans/guide/introduction" },
461461
{ text: "快速入门", link: "/zh-hans/guide/getting-started" },
462+
{
463+
text: "快速入门 (0.16.0 之前)",
464+
link: "/zh-hans/guide/getting-started-legacy",
465+
},
466+
{ text: "升级到 0.16.0", link: "/zh-hans/guide/upgrading-to-v0-16" },
462467
],
463468
},
464469
{
@@ -476,6 +481,7 @@ const zh_hans = [
476481
items: [
477482
{ text: "配置", link: "/zh-hans/manage/configuration" },
478483
{ text: "所有命令", link: "/zh-hans/manage/commands" },
484+
{ text: "依赖", link: "/zh-hans/manage/dependencies" },
479485
{
480486
text: "插件缩写索引",
481487
link: "https://github.com/asdf-vm/asdf-plugins",

docs/zh-hans/contribute/core.md

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ asdf install
4141

4242
```shell
4343
# 脚本检查
44-
./scripts/shellcheck.bash
44+
./scripts/lint.bash --check
4545

4646
# 格式化
47-
./scripts/shfmt.bash
47+
./scripts/lint.bash --fix
4848

4949
# 测试:所有案例
50-
bats test/
50+
./scripts/test.bash
51+
5152
# 测试:特定命令
5253
bats test/list_commands.bash
5354
```
@@ -58,9 +59,54 @@ bats test/list_commands.bash
5859

5960
:::
6061

62+
### Gitignore
63+
64+
以下是 `asdf-vm/asdf` 仓库中的 `.gitignore` 文件。我们忽略项目特定的文件。与操作系统、工具或工作流程相关的文件应在全 `.gitignore` 配置中忽略, [请查看此处](http://stratus3d.com/blog/2018/06/03/stop-excluding-editor-temp-files-in-gitignore/) 了解更多。
65+
66+
<<< @/../.gitignore
67+
68+
### `.git-blame-ignore-revs`
69+
70+
`asdf` 使用 `.git-blame-ignore-revs` 文件来减少在运行 blame 命令时的噪音。请查看 [git blame documentation](https://git-scm.com/docs/git-blame) 了解更多。
71+
72+
使用 `git blame` 时,可通过以下方式使用该文件:
73+
74+
```sh
75+
git blame --ignore-revs-file .git-blame-ignore-revs ./test/install_command.bats
76+
```
77+
78+
可选地,配置为在每次调用 `blame` 时自动使用该文件,无需手动提供:
79+
80+
```sh
81+
git config blame.ignoreRevsFile .git-blame-ignore-revs
82+
```
83+
84+
可以配置集成开发环境(IDEs)使用该文件。例如,在使用 VSCode (搭配 [GitLens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens)) 时,将以下内容写入 `.vscode/settings.json`
85+
86+
```json
87+
{
88+
"gitlens.advanced.blame.customArguments": [
89+
"--ignore-revs-file",
90+
".git-blame-ignore-revs"
91+
]
92+
}
93+
```
94+
6195
## Bats 测试
6296

63-
**强烈建议**在编写测试之前检查现有的测试套件和 [bats-core 文档](https://bats-core.readthedocs.io/en/stable/index.html)
97+
在本地执行测试:
98+
99+
```shell
100+
./scripts/test.bash
101+
```
102+
103+
在编写测试之前,**请务必阅读**
104+
105+
- `test/` 目录中的现有测试
106+
- [bats-core 文档](https://bats-core.readthedocs.io/en/stable/index.html)
107+
- `scripts/test.bash` 中使用的现有 Bats 设置
108+
109+
### Bats 提示
64110

65111
Bats 调试有时可能很困难。使用带有 `-t` 标识的 TAP 输出将使你能够在测试执行期间打印带有特殊文件描述符 `>&3` 的输出,从而简化调试。例如:
66112

@@ -71,7 +117,7 @@ printf "%s\n" "Will not be printed during bats test/some_tests.bats"
71117
printf "%s\n" "Will be printed during bats -t test/some_tests.bats" >&3
72118
```
73119

74-
进一步相关文档请查看 bats-core 的 [Printing to the Terminal](https://bats-core.readthedocs.io/en/stable/writing-tests.html#printing-to-the-terminal) 部分.
120+
进一步相关文档请查看 bats-core 的 [终端打印](https://bats-core.readthedocs.io/en/stable/writing-tests.html#printing-to-the-terminal) 部分.
75121

76122
## 拉取请求、发布以及约定式提交
77123

docs/zh-hans/contribute/documentation.md

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ npm install
3535

3636
## 开发
3737

38-
[Vuepress (v2)](https://v2.vuepress.vuejs.org/zh/) 是我们用来构建 asdf 文档网站的静态站点生成器(SSG)。它被选中来取代 [Docsify.js](https://docsify.js.org/#/zh-cn/),因为我们希望在用户没有可用或未启用 JavaScript 时支持仅依靠 HTML。Docsify 无法做到这一点。除此之外,两者特性集合大致相同,重点是 Vuepress 可以用最少的配置编写 Markdown 文件。
38+
[Vitepress (v2)](https://vitepress.dev/zh/) 是我们用来构建 asdf 文档网站的静态站点生成器(SSG)。它被选中来取代 [Docsify.js](https://docsify.js.org/#/zh-cn/),因为我们希望在用户没有可用或未启用 JavaScript 时支持仅依靠 HTML。Docsify 无法做到这一点。除此之外,两者特性集合大致相同,重点是 Vuepress 可以用最少的配置编写 Markdown 文件。
3939

4040
`package.json` 包含了开发所需的脚本:
4141

@@ -59,45 +59,58 @@ npm run format
5959

6060
当为文档更改创建 PR 请求时,请确保 PR 标题使用了约定式提交类型 `docs` 以及 `docs: <description>` 的格式。
6161

62-
## Vuepress
62+
## Vitepress
6363

6464
网站的配置包含在几个 JavaScript 文件中,其中 JS 对象用于表示配置。它们是:
6565

66-
- `docs/.vuepress/config.js`:网站的根配置文件。请查看 [Vuepress 文档](https://v2.vuepress.vuejs.org/zh/guide/configuration.html) 了解更多详情。
66+
- `docs/.vitepress/config.js`:网站的根配置文件。请查看 [Vitepress 文档](https://vitepress.dev/zh/reference/site-config) 了解更多详情。
6767

6868
为了简化根配置文件,更大的 JS 对象表示 _导航栏和侧边栏_ 配置已经被提取并按照语言类型分隔开来。请参考以下文件:
6969

70-
- `docs/.vuepress/navbar.js`
71-
- `docs/.vuepress/sidebar.js`
70+
- `docs/.vitepress/navbar.js`
71+
- `docs/.vitepress/sidebar.js`
7272

73-
这些配置的官方文档位于 [默认主题参考](https://v2.vuepress.vuejs.org/zh/reference/default-theme/config.html)
73+
这些配置的官方文档位于 [默认主题参考](https://vitepress.dev/zh/reference/default-theme-config)
7474

7575
## I18n 国际化
7676

77-
Vuepress 有一流的国际化支持。根配置文件 `docs/.vuepress/config.js` 定义了支持的语言类型及其 URL、在选择下拉菜单中的标题以及导航栏/侧边栏配置引用。
77+
Vitepress 有一流的国际化支持。根配置文件 `docs/.vitepress/config.js` 定义了支持的语言类型及其 URL、在选择下拉菜单中的标题以及导航栏/侧边栏配置引用。
7878

7979
导航栏/侧边栏配置在上述配置文件中捕获,按语言类型分隔开并单独导出。
8080

8181
每种语言的 markdown 内容必须位于与根配置文件中 `locale` 键同名的目录位置。也就是:
8282

8383
```js
84-
{
84+
// docs/.vitepress/config.js
85+
export default defineConfig({
8586
...
86-
themeConfig: {
87-
locales: {
88-
"/": {
89-
selectLanguageName: "English (US)",
90-
sidebar: sidebar.en,
91-
navbar: navbar.en
87+
locales: {
88+
root: {
89+
label: "English",
90+
lang: "en-US",
91+
themeConfig: {
92+
nav: navbars.en,
93+
sidebar: sidebars.en,
9294
},
93-
"/pt-BR/": {
94-
selectLanguageName: "Brazilian Portuguese",
95-
sidebar: sidebar.pt_br,
96-
navbar: navbar.pt_br
97-
}
98-
}
99-
}
100-
}
95+
},
96+
"pt-br": {
97+
label: "Brazilian Portuguese",
98+
lang: "pr-br",
99+
themeConfig: {
100+
nav: navbars.pt_br,
101+
sidebar: sidebars.pt_br,
102+
},
103+
},
104+
"zh-hans": {
105+
label: "简体中文",
106+
lang: "zh-hans",
107+
themeConfig: {
108+
nav: navbars.zh_hans,
109+
sidebar: sidebars.zh_hans,
110+
},
111+
},
112+
},
113+
})
101114
```
102115

103116
`/pt-BR/` 将要求 markdown 文件的同一集合位于 `docs/pt-BR/` 目录下,如下所示:
@@ -115,4 +128,4 @@ docs
115128
└─ README.md
116129
```
117130

118-
请查看 [Vuepress i18n 国际化官方文档](https://v2.vuepress.vuejs.org/zh/guide/i18n.html#%E7%AB%99%E7%82%B9%E5%A4%9A%E8%AF%AD%E8%A8%80%E9%85%8D%E7%BD%AE) 了解更多详情。
131+
请查看 [Vitepress i18n 国际化官方文档](https://vitepress.dev/zh/guide/i18n) 了解更多详情。

0 commit comments

Comments
 (0)