Skip to content

Commit 704f421

Browse files
committed
docs(zh-CN): Translate code examples to English
This commit updates the code examples in the Chinese documentation for data types (`types_of_data.md`). Variable names, string literals, and comments within the code blocks have been translated from Chinese to English. This change makes the examples more idiomatic and consistent with Nushell's English-based syntax, while keeping the surrounding explanatory text in Chinese.
1 parent 7ac222d commit 704f421

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

zh-CN/book/types_of_data.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Nushell 继承了这种方法,并扩展支持除字符串外的其他数据类
2222
| [字符串](#字符串) | `"第18洞"`, `'第18洞'`, \`第18洞\`, 第18洞, r#'第18洞'# |
2323
| [布尔值](#布尔值) | `true` |
2424
| [日期](#日期) | `2000-01-01` |
25-
| [时间间隔](#时间间隔) | `2分钟 + 12秒` |
25+
| [时间间隔](#时间间隔) | `2min + 12sec` |
2626
| [文件大小](#文件大小) | `64mb` |
2727
| [区间](#区间) | `0..4`, `0..<5`, `0..`, `..4` |
2828
| [二进制数据](#二进制数据) | `0x[FE FF]` |
@@ -96,9 +96,9 @@ Nushell提供了多种表示字符串的方式和许多处理字符串的命令
9696
简单示例:
9797

9898
```nu
99-
let audience: string = "世界"
100-
$"你好, ($audience)"
101-
# => 你好, 世界
99+
let audience: string = "World"
100+
$"Hello, ($audience)"
101+
# => Hello, World
102102
```
103103

104104
### 布尔值
@@ -116,17 +116,17 @@ $"你好, ($audience)"
116116
let mybool: bool = (2 > 1)
117117
$mybool
118118
# => true
119-
let 我的布尔值: bool = ($env.HOME | path exists)
120-
$我的布尔值
119+
let mybool: bool = ($env.HOME | path exists)
120+
$mybool
121121
# => true
122122
```
123123

124124
布尔结果常用于控制执行流程:
125125

126126
```nu
127127
let num = -2
128-
if $num < 0 { print "是负数" }
129-
# => 是负数
128+
if $num < 0 { print "It's negative" }
129+
# => It's negative
130130
```
131131

132132
### 日期
@@ -141,7 +141,7 @@ if $num < 0 { print "是负数" }
141141

142142
```nu
143143
date now
144-
# => 2024年8月12日 13:59:22 -0400 (现在)
144+
# => Mon, 12 Aug 2024 13:59:22 -0400 (now)
145145
# 格式化为Unix时间戳
146146
date now | format date '%s'
147147
# => 1723485562
@@ -160,9 +160,9 @@ date now | format date '%s'
160160
简单示例:
161161

162162
```nu
163-
3.14天
164-
# => 3天3小时21分钟
165-
30天 / 1秒 # 30天有多少秒?
163+
3.14day
164+
# => 3day 3hr 21min
165+
30day / 1sec # How many seconds in 30 days?
166166
# => 2592000
167167
```
168168

@@ -319,16 +319,16 @@ Nushell包含一组可以包含上述基本类型的结构化数据类型。例
319319

320320
```nu
321321
let my_record = {
322-
姓名: "张三"
323-
等级: 99
322+
name: "张三"
323+
rank: 99
324324
}
325325
$my_record
326326
# => ╭───────┬────────────╮
327-
# => │ 姓名 │ 张三 │
328-
# => │ 等级 │ 99 │
327+
# => │ name │ 张三 │
328+
# => │ rank │ 99 │
329329
# => ╰───────┴────────────╯
330330
331-
$我的记录 | get 姓名
331+
$my_record | get name
332332
# => 张三
333333
```
334334

@@ -380,10 +380,10 @@ $我的记录 | get 姓名
380380
简单示例:
381381

382382
```nu
383-
if true { print "是真的" }
383+
if true { print "It's true" }
384384
```
385385

386-
上面的`{ print "是真的" }`部分就是一个代码块。
386+
上面的`{ print "It's true" }`部分就是一个代码块。
387387

388388
### 空值
389389

@@ -402,10 +402,10 @@ if true { print "是真的" }
402402
let simple_record = { a: 5, b: 10 }
403403
$simple_record.a?
404404
# => 5
405-
$简单记录.c?
406-
# => 无输出
407-
$简单记录.c? | describe
405+
$simple_record.c?
406+
# => Nothing is output
407+
$simple_record.c? | describe
408408
# => nothing
409-
$简单记录.c? == null
409+
$simple_record.c? == null
410410
# => true
411411
```

0 commit comments

Comments
 (0)