Skip to content

Commit 5961ce6

Browse files
authored
update zh-CN Translation (nushell#2012)
* update zh-CN Translation * Fix image path in stdout_stderr_exit_codes.md documentation The image path was incorrect, using '../assets' instead of '../../assets'. This change corrects the relative path to ensure the image displays properly in the documentation. * accept hustcer's review * Fixed ::: incorrect indentation issue * accept hustcer's review * accept hustcer's review * some small fix * Update hook links to use relative paths for better documentation navigation * Update overlay links to use relative paths in setup documentation * Fix markdown links (../book/hooks => ../book/hooks.md)in cookbook setup documentation * [zh-CN] 您 -> 你
1 parent 4a740d2 commit 5961ce6

File tree

98 files changed

+18697
-3227
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+18697
-3227
lines changed

.vuepress/configs/navbar/zh-CN.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
import type { NavbarConfig } from '@vuepress/theme-default';
22

33
export const navbarZhCN: NavbarConfig = [
4-
{ text: '书', link: '/zh-CN/book/' },
5-
// { text: "Contributor Book", link: "/contributor-book/" },
6-
{ text: 'Cookbook', link: '/cookbook/' },
4+
{ text: '安装 Nu !', link: '/zh-CN/book/installation' },
5+
{ text: '快速开始', link: '/zh-CN/book/getting_started' },
6+
{
7+
text: '文档',
8+
children: [
9+
{ text: 'Nushell 之书', link: '/zh-CN/book/' },
10+
{ text: '命令参考列表', link: '/commands/' },
11+
{ text: '实战指南', link: '/zh-CN/cookbook/' },
12+
{ text: '语言参考指南', link: '/lang-guide/' },
13+
{ text: '贡献指南', link: '/zh-CN/contributor-book/' },
14+
],
15+
},
716
{ text: '博客', link: '/blog/' },
817
];

.vuepress/configs/sidebar/zh-CN.ts

Lines changed: 132 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,172 @@
11
import type { SidebarConfig } from '@vuepress/theme-default';
2+
import { commandCategories } from './command_categories';
23

34
export const sidebarZhCN: SidebarConfig = {
45
'/zh-CN/book/': [
56
{
6-
text: '入门篇',
7+
text: '简介',
8+
link: '/zh-CN/book/README.md',
9+
collapsible: false,
10+
},
11+
{
12+
text: '安装',
13+
link: '/zh-CN/book/installation.md',
14+
collapsible: false,
15+
children: ['/zh-CN/book/default_shell.md'],
16+
},
17+
{
18+
text: '快速入门',
19+
link: '/zh-CN/book/getting_started.md',
720
collapsible: false,
821
children: [
9-
'/zh-CN/book/README.md',
10-
'/zh-CN/book/installation',
11-
'/zh-CN/book/thinking_in_nu',
12-
'/zh-CN/book/moving_around',
22+
'/zh-CN/book/quick_tour.md',
23+
'/zh-CN/book/moving_around.md',
24+
'/zh-CN/book/thinking_in_nu.md',
25+
'/zh-CN/book/cheat_sheet.md',
1326
],
1427
},
1528
{
1629
text: 'Nu 基础篇',
30+
link: '/zh-CN/book/nu_fundamentals.md',
1731
collapsible: false,
1832
children: [
19-
'/zh-CN/book/types_of_data',
20-
'/zh-CN/book/loading_data',
21-
'/zh-CN/book/working_with_strings',
22-
'/zh-CN/book/working_with_lists',
23-
'/zh-CN/book/working_with_tables',
24-
'/zh-CN/book/pipelines',
25-
'/zh-CN/book/command_reference',
33+
'/zh-CN/book/types_of_data.md',
34+
'/zh-CN/book/loading_data.md',
35+
'/zh-CN/book/pipelines.md',
36+
'/zh-CN/book/working_with_strings.md',
37+
'/zh-CN/book/working_with_lists.md',
38+
'/zh-CN/book/working_with_records.md',
39+
'/zh-CN/book/working_with_tables.md',
40+
'/zh-CN/book/navigating_structured_data.md',
41+
'/zh-CN/book/special_variables.md',
2642
],
2743
},
2844
{
2945
text: 'Nushell 编程',
46+
link: '/zh-CN/book/programming_in_nu.md',
3047
collapsible: false,
3148
children: [
32-
'/zh-CN/book/custom_commands',
33-
'/zh-CN/book/aliases',
34-
'/zh-CN/book/operators',
35-
'/zh-CN/book/variables_and_subexpressions',
36-
'/zh-CN/book/scripts',
37-
'/zh-CN/book/modules',
38-
'/zh-CN/book/overlays',
49+
'/zh-CN/book/custom_commands.md',
50+
'/zh-CN/book/aliases.md',
51+
'/zh-CN/book/operators.md',
52+
'/zh-CN/book/variables.md',
53+
'/zh-CN/book/control_flow.md',
54+
'/zh-CN/book/scripts.md',
55+
{
56+
text: '模块',
57+
link: '/zh-CN/book/modules.md',
58+
collapsible: false,
59+
children: [
60+
'/zh-CN/book/modules/using_modules.md',
61+
'/zh-CN/book/modules/creating_modules.md',
62+
],
63+
},
64+
'/zh-CN/book/overlays.md',
65+
'/zh-CN/book/sorting.md',
66+
'/zh-CN/book/testing.md',
67+
'/zh-CN/book/style_guide.md',
3968
],
4069
},
4170
{
4271
text: 'Nu 作为 Shell 使用',
72+
link: '/zh-CN/book/nu_as_a_shell.md',
4373
collapsible: false,
4474
children: [
45-
'/zh-CN/book/configuration',
46-
'/zh-CN/book/environment',
47-
'/zh-CN/book/stdout_stderr_exit_codes',
48-
'/zh-CN/book/escaping',
49-
'/zh-CN/book/3rdpartyprompts',
50-
'/zh-CN/book/shells_in_shells',
51-
'/zh-CN/book/line_editor',
52-
'/zh-CN/book/externs',
53-
'/zh-CN/book/custom_completions',
54-
'/zh-CN/book/coloring_and_theming',
75+
'/zh-CN/book/configuration.md',
76+
'/zh-CN/book/environment.md',
77+
'/zh-CN/book/stdout_stderr_exit_codes.md',
78+
'/zh-CN/book/running_externals.md',
79+
'/zh-CN/book/3rdpartyprompts.md',
80+
'/zh-CN/book/directory_stack.md',
81+
'/zh-CN/book/line_editor.md',
82+
'/zh-CN/book/custom_completions.md',
83+
'/zh-CN/book/externs.md',
84+
'/zh-CN/book/coloring_and_theming.md',
5585
'/zh-CN/book/hooks.md',
86+
'/zh-CN/book/background_jobs.md',
5687
],
5788
},
5889
{
5990
text: '迁移到 Nu',
91+
link: '/zh-CN/book/coming_to_nu.md',
6092
collapsible: false,
6193
children: [
62-
'/zh-CN/book/coming_from_bash',
63-
'/zh-CN/book/nushell_map',
64-
'/zh-CN/book/nushell_map_imperative',
65-
'/zh-CN/book/nushell_map_functional',
66-
'/zh-CN/book/nushell_operator_map',
94+
'/zh-CN/book/coming_from_bash.md',
95+
'/zh-CN/book/coming_from_cmd.md',
96+
'/zh-CN/book/nushell_map.md',
97+
'/zh-CN/book/nushell_map_imperative.md',
98+
'/zh-CN/book/nushell_map_functional.md',
99+
'/zh-CN/book/nushell_operator_map.md',
67100
],
68101
},
69102
{
70-
text: '高级篇',
103+
text: '设计说明',
104+
link: '/zh-CN/book/design_notes.md',
105+
collapsible: false,
106+
children: ['/zh-CN/book/how_nushell_code_gets_run.md'],
107+
},
108+
{
109+
text: '(不怎么)高级篇',
110+
link: '/zh-CN/book/advanced.md',
111+
collapsible: false,
112+
children: [
113+
'/zh-CN/book/standard_library.md',
114+
'/zh-CN/book/dataframes.md',
115+
'/zh-CN/book/metadata.md',
116+
'/zh-CN/book/creating_errors.md',
117+
'/zh-CN/book/parallelism.md',
118+
'/zh-CN/book/plugins.md',
119+
'/zh-CN/book/explore.md',
120+
],
121+
},
122+
],
123+
'/commands/': [
124+
{
125+
text: '命令分类',
126+
collapsible: false,
127+
children: commandCategories,
128+
},
129+
],
130+
'/zh-CN/contributor-book/': [
131+
{
132+
text: '贡献者指南',
133+
link: '/zh-CN/contributor-book/README.md',
134+
collapsible: false,
135+
children: [
136+
'/zh-CN/contributor-book/README.md',
137+
'/zh-CN/contributor-book/philosophy',
138+
'/zh-CN/contributor-book/philosophy_0_80',
139+
'/zh-CN/contributor-book/commands',
140+
'/zh-CN/contributor-book/plugins',
141+
'/zh-CN/contributor-book/plugin_protocol_reference',
142+
],
143+
},
144+
],
145+
'/zh-CN/cookbook/': [
146+
{
147+
text: '实战指南',
71148
collapsible: false,
72149
children: [
73-
'/zh-CN/book/dataframes',
74-
'/zh-CN/book/metadata',
75-
'/zh-CN/book/creating_errors',
76-
'/zh-CN/book/parallelism',
77-
'/zh-CN/book/plugins',
150+
'/zh-CN/cookbook/README.md',
151+
'/zh-CN/cookbook/setup',
152+
'/zh-CN/cookbook/help',
153+
'/zh-CN/cookbook/system',
154+
'/zh-CN/cookbook/parsing',
155+
'/zh-CN/cookbook/foreign_shell_scripts',
156+
'/zh-CN/cookbook/pattern_matching',
157+
'/zh-CN/cookbook/custom_completers',
158+
'/zh-CN/cookbook/external_completers',
159+
'/zh-CN/cookbook/modules',
160+
'/zh-CN/cookbook/files',
161+
'/zh-CN/cookbook/git',
162+
'/zh-CN/cookbook/parsing_git_log',
163+
'/zh-CN/cookbook/input_listen_keys',
164+
'/zh-CN/cookbook/http',
165+
'/zh-CN/cookbook/direnv',
166+
'/zh-CN/cookbook/ssh_agent',
167+
'/zh-CN/cookbook/tables',
168+
'/zh-CN/cookbook/polars_v_pandas_v_nushell',
169+
'/zh-CN/cookbook/jq_v_nushell',
78170
],
79171
},
80172
],

cookbook/setup.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Because you can append a list of paths, you can append multiple at once. You can
3232
$env.PATH ++= [ '~/.local/bin', ($env.CARGO_HOME | path join "bin") ]
3333
```
3434

35-
Because PATH order makes a difference, you may want to *prepend* your paths instead, so that they take precedence over other executables with the same name:
35+
Because PATH order makes a difference, you may want to _prepend_ your paths instead, so that they take precedence over other executables with the same name:
3636

3737
```
3838
use std/util "path add"
@@ -84,6 +84,7 @@ You should now be able to run `config nu` or `config env` and edit those files e
8484
```nu
8585
$env.APPDATA
8686
```
87+
8788
---
8889

8990
### Use hooks to export state via environment variables
@@ -95,11 +96,11 @@ To be most compatible, the `starship` binary will run every prompt render and
9596
is absolute stateless.
9697
Nushell, however, is very stateful in a single instance.
9798

98-
[Hooks](https://www.nushell.sh/book/hooks.html#hooks) allow registration of
99+
[Hooks](../book/hooks.md) allow registration of
99100
custom callback functions.
100101
In this case, the `pre_prompt` hook is very useful.
101102
With it, we can export state information as an environment variable, for
102-
example, what [overlays](https://www.nushell.sh/book/overlays.html) are
103+
example, what [overlays](../book/overlays.md) are
103104
currently activated.
104105

105106
```nu

zh-CN/README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ actionText: 点此了解更多 →
77
actionLink: /zh-CN/book/
88
features:
99
- title: 利用管道控制任意系统
10-
details: Nu 可以在 Linux、macOS 和 Windows 上运行。一次学习,处处可用。
10+
details: Nu 可以在 Linux、macOS、BSD 和 Windows 上运行。一次学习,处处可用。
1111
- title: 一切皆数据
1212
details: Nu 管道使用结构化数据,你可以用同样的方式安全地选择,过滤和排序。停止解析字符串,开始解决问题。
1313
- title: 强大的插件系统
@@ -34,20 +34,39 @@ Nushell 可以通过 [你喜欢的软件包管理器](https://repology.org/proje
3434

3535
#### macOS / Linux:
3636

37+
##### Homebrew
38+
3739
```shell
3840
$ brew install nushell
3941
```
4042

43+
##### Nix profile
44+
45+
```shell
46+
$ nix profile install nixpkgs#nushell
47+
```
48+
4149
#### Windows:
4250

4351
```powershell
52+
# 安装到用户范围(默认)。
4453
winget install nushell
54+
# 系统范围安装(以管理员身份运行)。
55+
winget install nushell --scope machine
4556
```
4657

4758
完成安装后,输入 `nu` 来启动 Nu。
4859

60+
## 文档
61+
62+
- [入门](/zh-CN/book/getting_started.html) 指引你熟悉 Nushell
63+
- [Nu 之异同](/zh-CN/book/coming_to_nu.html) 描述了 Nu 与其他语言和 Shell 的异同之处
64+
- [Nu 基础](/zh-CN/book/nu_fundamentals.html) 是对 Nu 基础知识更详尽、更有条理的描述
65+
- [Nu 编程](/zh-CN/book/programming_in_nu.html) 将 Nu 作为一门编程语言进行描述
66+
- [作为 Shell 的 Nu](/zh-CN/book/nu_as_a_shell.html) 让你深入了解 Shell 环境中的交互功能和可配置性
67+
4968
## 社区
5069

5170
如果你有任何问题可以在 [Discord](https://discord.gg/NtAbbGn) 上找到我们。
5271

53-
您可以通过 [意见反馈](https://github.com/nushell/nushell.github.io/issues) 或者 [贡献 PR](https://github.com/nushell/nushell.github.io/pulls) 来帮助我们完善此网站。
72+
你可以通过 [意见反馈](https://github.com/nushell/nushell.github.io/issues) 或者 [贡献 PR](https://github.com/nushell/nushell.github.io/pulls) 来帮助我们完善此网站。

0 commit comments

Comments
 (0)