Skip to content

Commit 05c06d7

Browse files
committed
Update Chinese translations in zh.po file
1 parent ea92ad0 commit 05c06d7

File tree

1 file changed

+58
-56
lines changed

1 file changed

+58
-56
lines changed

po/zh.po

Lines changed: 58 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2201,17 +2201,19 @@ msgstr "// 变量可以通过遮蔽(shadowing)来覆盖。\n"
22012201

22022202
#: src/primitives.md:53
22032203
msgid "/* Compound types - Array and Tuple */"
2204-
msgstr ""
2204+
msgstr "/* 复合类型 - 数组和元组 */"
22052205

22062206
#: src/primitives.md:55
22072207
msgid "// Array signature consists of Type T and length as [T; length].\n"
2208-
msgstr ""
2208+
msgstr "// 数组的签名由类型 T 和长度组成,表示为 [T; length]。\n"
22092209

22102210
#: src/primitives.md:58
22112211
msgid ""
22122212
"// Tuple is a collection of values of different types \n"
22132213
" // and is constructed using parentheses ().\n"
22142214
msgstr ""
2215+
"// 元组是不同类型值的集合,\n"
2216+
" // 使用圆括号 () 构造。\n"
22152217

22162218
#: src/primitives.md:66
22172219
msgid ""
@@ -3081,7 +3083,6 @@ msgstr ""
30813083
"and-lifetimes/default-match-bindings.html\n"
30823084

30833085
#: src/custom_types/enum/testcase_linked_list.md:39
3084-
#, fuzzy
30853086
msgid ""
30863087
"// Can't take ownership of the tail, because `self` is borrowed;\n"
30873088
" // instead take a reference to the tail\n"
@@ -3090,6 +3091,7 @@ msgid ""
30903091
msgstr ""
30913092
"// 无法获取 tail 的所有权,因为 `self` 是借用的;\n"
30923093
" // 所以取 tail 的引用\n"
3094+
" // 这是一个非尾递归调用,对于长列表可能导致栈溢出。\n"
30933095

30943096
#: src/custom_types/enum/testcase_linked_list.md:43
30953097
msgid "// Base Case: An empty list has zero length\n"
@@ -3365,15 +3367,14 @@ msgid "\"shadowed in outer block: {}\""
33653367
msgstr "\"外部代码块中被遮蔽:{}\""
33663368

33673369
#: src/variable_bindings/declare.md:3
3368-
#, fuzzy
33693370
msgid ""
33703371
"It is possible to declare variable bindings first and initialize them later, "
33713372
"but all variable bindings must be initialized before they are used: the "
33723373
"compiler forbids use of uninitialized variable bindings, as it would lead to "
33733374
"undefined behavior."
33743375
msgstr ""
3375-
"可以先声明变量绑定,然后再初始化。但这种形式很少使用,因为它可能导致使用未初"
3376-
"始化的变量。"
3376+
"可以先声明变量绑定然后再初始化,但所有变量绑定在使用前必须先初始化:编译器禁"
3377+
"止使用未初始化的变量绑定,因为这会导致未定义行为。"
33773378

33783379
#: src/variable_bindings/declare.md:5
33793380
msgid ""
@@ -3382,6 +3383,9 @@ msgid ""
33823383
"when initialization is separated from declaration. It is common to declare "
33833384
"and initialize a variable binding near where the variable will be used."
33843385
msgstr ""
3386+
"在函数中先声明变量绑定而稍后再初始化的做法并不常见。当初始化与声明分离时,读"
3387+
"者更难找到初始化的位置。更常见的做法是在变量即将使用的地方附近声明并初始化变"
3388+
"量绑定。"
33853389

33863390
#: src/variable_bindings/declare.md:11
33873391
msgid "// Declare a variable binding\n"
@@ -3883,7 +3887,6 @@ msgid "// Try removing the type annotation\n"
38833887
msgstr "// 尝试移除类型标注\n"
38843888

38853889
#: src/conversion/from_into.md:72
3886-
#, fuzzy
38873890
msgid "`From` and `Into` are interchangeable"
38883891
msgstr "`From` 和 `Into` 是可互换的"
38893892

@@ -3941,7 +3944,6 @@ msgid "Converting to String"
39413944
msgstr "转换为字符串"
39423945

39433946
#: src/conversion/string.md:5
3944-
#, fuzzy
39453947
msgid ""
39463948
"To convert any type to a `String` is as simple as implementing the "
39473949
"[`ToString`](https://doc.rust-lang.org/std/string/trait.ToString.html) trait "
@@ -3951,13 +3953,12 @@ msgid ""
39513953
"string/trait.ToString.html) and also allows printing the type as discussed "
39523954
"in the section on [`print!`](../hello/print.md)."
39533955
msgstr ""
3954-
"要将任何类型转换为 `String`,只需为该类型实现 [`ToString`] 特质即可。但更好的"
3955-
"做法是实现 [`fmt::Display`] 特质,它不仅会自动提供 [`ToString`],还允许打印该"
3956-
"类型,就像在 [`print!`] 部分讨论的那样。\n"
3957-
"\n"
3958-
"[`ToString`]: https://doc.rust-lang.org/std/string/trait.ToString.html\n"
3959-
"[`fmt::Display`]: https://doc.rust-lang.org/std/fmt/trait.Display.html\n"
3960-
"[`print!`]: ../hello/print.md"
3956+
"要将任何类型转换为 `String`,只需为该类型实现 [`ToString`](https://doc.rust-"
3957+
"lang.org/std/string/trait.ToString.html) 特质即可。但更好的做法是实现 "
3958+
"[`fmt::Display`](https://doc.rust-lang.org/std/fmt/trait.Display.html) 特质,"
3959+
"它不仅会自动提供 [`ToString`](https://doc.rust-lang.org/std/string/trait."
3960+
"ToString.html),还允许打印该类型,就像在 [`print!`](../hello/print.md) 部分"
3961+
"讨论的那样。"
39613962

39623963
#: src/conversion/string.md:19
39633964
msgid "\"Circle of radius {}\""
@@ -9110,7 +9111,6 @@ msgid "\"mutable_box now contains {}\""
91109111
msgstr "\"mutable_box 现在包含 {}\""
91119112

91129113
#: src/scope/move/partial_move.md:3
9113-
#, fuzzy
91149114
msgid ""
91159115
"Within the [destructuring](../../flow_control/match/destructuring.md) of a "
91169116
"single variable, both `by-move` and `by-reference` pattern bindings can be "
@@ -9125,7 +9125,9 @@ msgstr ""
91259125
"在对单个变量进行[解构](../../flow_control/match/destructuring.md)时,可以同时"
91269126
"使用 `by-move` 和 `by-reference` 模式绑定。这样做会导致变量的**部分移动**,这"
91279127
"意味着变量的一部分会被移动,而其他部分保持不变。在这种情况下,父级变量之后不"
9128-
"能作为一个整体使用,但是仍然可以使用只被引用(而不是被移动)的部分。"
9128+
"能作为一个整体使用,但是仍然可以使用只被引用(而不是被移动)的部分。注意,实"
9129+
"现了 [`Drop` 特质](../../trait/drop.md) 的类型不能被部分移动,因为其 `drop` "
9130+
"方法会在之后将其作为整体使用。"
91299131

91309132
#: src/scope/move/partial_move.md:22
91319133
msgid ""
@@ -9137,6 +9139,13 @@ msgid ""
91379139
" //}\n"
91389140
" // TODO ^ Try uncommenting these lines\n"
91399141
msgstr ""
9142+
"// 错误!无法从实现了 `Drop` 特质的类型中移动\n"
9143+
" //impl Drop for Person {\n"
9144+
" // fn drop(&mut self) {\n"
9145+
" // println!(\"Dropping the person struct {:?}\", self)\n"
9146+
" // }\n"
9147+
" //}\n"
9148+
" // TODO ^ 尝试取消注释这些行\n"
91409149

91419150
#: src/scope/move/partial_move.md:35
91429151
msgid "// `name` is moved out of person, but `age` is referenced\n"
@@ -10098,7 +10107,6 @@ msgid "\"NUM: {} stays accessible!\""
1009810107
msgstr "\"NUM:{} 仍然可以访问!\""
1009910108

1010010109
#: src/scope/lifetime/static_lifetime.md:65
10101-
#, fuzzy
1010210110
msgid ""
1010310111
"Since `'static` references only need to be valid for the _remainder_ of a "
1010410112
"program's life, they can be created while the program is executed. Just to "
@@ -10659,70 +10667,70 @@ msgid ""
1065910667
"For a more practical example, here's how the `Drop` trait can be used to "
1066010668
"automatically clean up temporary files when they're no longer needed:"
1066110669
msgstr ""
10670+
"下面是一个更实用的例子,展示如何使用 `Drop` 特质在不再需要临时文件时自动清理"
10671+
"它们:"
1066210672

1066310673
#: src/trait/drop.md:71
1066410674
msgid "// Note: File::create() will overwrite existing files\n"
10665-
msgstr ""
10675+
msgstr "// 注意:File::create() 会覆盖现有文件\n"
1066610676

1066710677
#: src/trait/drop.md:77
1066810678
msgid ""
1066910679
"// When TempFile is dropped:\n"
1067010680
"// 1. First, the File will be automatically closed (Drop for File)\n"
1067110681
"// 2. Then our drop implementation will remove the file\n"
1067210682
msgstr ""
10683+
"// 当 TempFile 被丢弃时:\n"
10684+
"// 1. 首先,File 会自动关闭(File 的 Drop 实现)\n"
10685+
"// 2. 然后我们的 drop 实现会删除文件\n"
1067310686

1067410687
#: src/trait/drop.md:83
10675-
#, fuzzy
1067610688
msgid "// Note: File is already closed at this point\n"
10677-
msgstr "// `_x` 应该在此处被销毁\n"
10689+
msgstr "// 注意:文件在此时已经关闭\n"
1067810690

1067910691
#: src/trait/drop.md:85
10680-
#, fuzzy
1068110692
msgid "\"Failed to remove temporary file: {}\""
10682-
msgstr "\"执行进程失败:{}\""
10693+
msgstr "\"删除临时文件失败:{}\""
1068310694

1068410695
#: src/trait/drop.md:87
1068510696
msgid "\"> Dropped temporary file: {:?}\""
10686-
msgstr ""
10697+
msgstr "\"> 已丢弃临时文件:{:?}\""
1068710698

1068810699
#: src/trait/drop.md:92
1068910700
msgid "// Create a new scope to demonstrate drop behavior\n"
10690-
msgstr ""
10701+
msgstr "// 创建新作用域来演示丢弃行为\n"
1069110702

1069210703
#: src/trait/drop.md:94
10693-
#, fuzzy
1069410704
msgid "\"test.txt\""
10695-
msgstr "\"ferris.txt\""
10705+
msgstr "\"test.txt\""
1069610706

1069710707
#: src/trait/drop.md:95
1069810708
msgid "\"Temporary file created\""
10699-
msgstr ""
10709+
msgstr "\"已创建临时文件\""
1070010710

1070110711
#: src/trait/drop.md:96
1070210712
msgid "// File will be automatically cleaned up when temp goes out of scope\n"
10703-
msgstr ""
10713+
msgstr "// 当 temp 超出作用域时,文件会自动清理\n"
1070410714

1070510715
#: src/trait/drop.md:98
1070610716
msgid "\"End of scope - file should be cleaned up\""
10707-
msgstr ""
10717+
msgstr "\"作用域结束 - 文件应该被清理\""
1070810718

1070910719
#: src/trait/drop.md:100
1071010720
msgid "// We can also manually drop if needed\n"
10711-
msgstr ""
10721+
msgstr "// 如果需要,我们也可以手动丢弃\n"
1071210722

1071310723
#: src/trait/drop.md:101
10714-
#, fuzzy
1071510724
msgid "\"another_test.txt\""
10716-
msgstr "\"ferris.txt\""
10725+
msgstr "\"another_test.txt\""
1071710726

1071810727
#: src/trait/drop.md:102
10719-
#, fuzzy
1072010728
msgid "// Explicitly drop the file\n"
10721-
msgstr "// 显式转换\n"
10729+
msgstr "// 显式丢弃文件\n"
1072210730

1072310731
#: src/trait/drop.md:103
1072410732
msgid "\"Manually dropped file\""
10725-
msgstr ""
10733+
msgstr "\"手动丢弃的文件\""
1072610734

1072710735
#: src/trait/iter.md:3
1072810736
msgid ""
@@ -10751,15 +10759,15 @@ msgstr ""
1075110759
"lang.org/std/iter/trait.IntoIterator.html) 方法将某些集合转换为迭代器。"
1075210760

1075310761
#: src/trait/iter.md:18
10754-
#, fuzzy
1075510762
msgid ""
1075610763
"// Implement `Iterator` for `Fibonacci`.\n"
1075710764
"// The `Iterator` trait only requires a method to be defined for the `next` "
1075810765
"element,\n"
1075910766
"// and an `associated type` to declare the return type of the iterator.\n"
1076010767
msgstr ""
1076110768
"// 为 `Fibonacci` 实现 `Iterator`。\n"
10762-
"// `Iterator` trait 只要求为 `next` 元素定义一个方法。\n"
10769+
"// `Iterator` 特质只要求为 `next` 元素定义一个方法,\n"
10770+
"// 并需要一个`关联类型`来声明迭代器的返回类型。\n"
1076310771

1076410772
#: src/trait/iter.md:23
1076510773
msgid "// We can refer to this type using Self::Item\n"
@@ -11192,9 +11200,8 @@ msgstr ""
1119211200
"calling-methods-with-the-same-name)"
1119311201

1119411202
#: src/macros.md:1
11195-
#, fuzzy
1119611203
msgid "`macro_rules!`"
11197-
msgstr "macro_rules!"
11204+
msgstr "`macro_rules!`"
1119811205

1119911206
#: src/macros.md:3
1120011207
msgid ""
@@ -11657,7 +11664,6 @@ msgstr ""
1165711664
"栈,并通常会退出程序。在这里,我们在错误条件下显式调用 `panic`:"
1165811665

1165911666
#: src/error/panic.md:9
11660-
#, fuzzy
1166111667
msgid "// You shouldn't drink too many sugary beverages.\n"
1166211668
msgstr "// 你不应该喝太多含糖饮料。\n"
1166311669

@@ -11859,14 +11865,13 @@ msgstr ""
1185911865
"将终止当前执行的函数并返回 `None`。"
1186011866

1186111867
#: src/error/option_unwrap/question_mark.md:10
11862-
#, fuzzy
1186311868
msgid ""
1186411869
"// If `current_age` is `None`, this returns `None`.\n"
1186511870
" // If `current_age` is `Some`, the inner `u8` value + 1\n"
1186611871
" // gets assigned to `next_age`\n"
1186711872
msgstr ""
1186811873
"// 如果 `current_age` 是 `None`,这将返回 `None`。\n"
11869-
"\t// 如果 `current_age` 是 `Some`,内部的 `u8` 值加 1\n"
11874+
" // 如果 `current_age` 是 `Some`,内部的 `u8` 值加 1\n"
1187011875
" // 后被赋值给 `next_age`\n"
1187111876

1187211877
#: src/error/option_unwrap/question_mark.md:14
@@ -14497,7 +14502,6 @@ msgid "These threads will be scheduled by the OS."
1449714502
msgstr "这些线程将由操作系统进行调度。"
1449814503

1449914504
#: src/std_misc/threads/testcase_mapreduce.md:3
14500-
#, fuzzy
1450114505
msgid ""
1450214506
"Rust makes it very easy to parallelize data processing, without many of the "
1450314507
"headaches traditionally associated with such an attempt."
@@ -14513,14 +14517,13 @@ msgstr ""
1451314517
"则,自动防止了数据竞争。"
1451414518

1451514519
#: src/std_misc/threads/testcase_mapreduce.md:9
14516-
#, fuzzy
1451714520
msgid ""
1451814521
"The aliasing rules (one writable reference XOR many readable references) "
1451914522
"automatically prevent you from manipulating state that is visible to other "
1452014523
"threads. (Where synchronization is needed, there are synchronization "
1452114524
"primitives like `Mutex`es or `Channel`s.)"
1452214525
msgstr ""
14523-
"别名规则(一个可写引用或多个可读引用)自动防止你操作对其他线程可见的状态。"
14526+
"别名规则(一个可写引用异或多个可读引用)自动防止你操作对其他线程可见的状态。"
1452414527
"(在需要同步的情况下,可以使用 `Mutex` 或 `Channel` 等同步原语。)"
1452514528

1452614529
#: src/std_misc/threads/testcase_mapreduce.md:14
@@ -15294,13 +15297,12 @@ msgid ""
1529415297
msgstr "(建议您尝试在上述示例中向 `rustc` 传递一个错误的标志)"
1529515298

1529615299
#: src/std_misc/process/pipe.md:3
15297-
#, fuzzy
1529815300
msgid ""
1529915301
"The `std::process::Child` struct represents a child process, and exposes the "
1530015302
"`stdin`, `stdout` and `stderr` handles for interaction with the underlying "
1530115303
"process via pipes."
1530215304
msgstr ""
15303-
"`std::Child` 结构体代表一个正在运行的子进程,它暴露了 `stdin`、`stdout` 和 "
15305+
"`std::process::Child` 结构体代表一个子进程,它暴露了 `stdin`、`stdout` 和 "
1530415306
"`stderr` 句柄,允许通过管道与底层进程进行交互。"
1530515307

1530615308
#: src/std_misc/process/pipe.md:11
@@ -15934,6 +15936,9 @@ msgid ""
1593415936
"which works exactly like `#[should_panic(expected = \"message\")]`. Both are "
1593515937
"valid; the latter is more commonly used and is considered more explicit."
1593615938
msgstr ""
15939+
"**注意**:Rust 还允许使用简写形式 `#[should_panic = \"message\"]`,其功能与 "
15940+
"`#[should_panic(expected = \"message\")]` 完全相同。两种形式都有效;后者更常"
15941+
"用,被认为更明确。"
1593715942

1593815943
#: src/testing/unit_testing.md:117 src/testing/doc_testing.md:46
1593915944
msgid "\"Divide-by-zero error\""
@@ -15945,9 +15950,8 @@ msgid "\"Divide result is zero\""
1594515950
msgstr "\"除法结果为零\""
1594615951

1594715952
#: src/testing/unit_testing.md:146
15948-
#, fuzzy
1594915953
msgid "// This also works\n"
15950-
msgstr "// 加法运算正常工作。\n"
15954+
msgstr "// 这样也可以\n"
1595115955

1595215956
#: src/testing/unit_testing.md:153
1595315957
msgid "Running these tests gives us:"
@@ -17118,7 +17122,7 @@ msgid ""
1711817122
msgstr "首先,同一个数字可以在同一个内联块中多次用作标签。"
1711917123

1712017124
#: src/unsafe/asm.md:453
17121-
#, fuzzy
17125+
1712217126
msgid ""
1712317127
"Second, that when a numeric label is used as a reference (as an instruction "
1712417128
"operand, for example), the suffixes “b” (“backward”) or ”f” (“forward”) "
@@ -17202,14 +17206,13 @@ msgstr ""
1720217206
"stable/reference/inline-assembly.html)。"
1720317207

1720417208
#: src/compatibility.md:3
17205-
#, fuzzy
1720617209
msgid ""
1720717210
"The Rust language is evolving rapidly, and because of this certain "
1720817211
"compatibility issues can arise, despite efforts to ensure forwards-"
1720917212
"compatibility wherever possible."
1721017213
msgstr ""
17211-
"Rust 语言正在快速发展。尽管我们努力确保尽可能的向前兼容,但某些兼容性问题仍可"
17212-
"能出现。"
17214+
"Rust 语言正在快速发展,因此某些兼容性问题可能会出现,尽管我们努力确保尽可能"
17215+
"的向前兼容。"
1721317216

1721417217
#: src/compatibility.md:7
1721517218
msgid "[Raw identifiers](compatibility/raw_identifiers.md)"
@@ -17542,7 +17545,6 @@ msgstr ""
1754217545
"attribute.html#html_playground_url)。"
1754317546

1754417547
#: src/meta/playground.md:42
17545-
#, fuzzy
1754617548
msgid ""
1754717549
"````text\n"
1754817550
"#![doc(html_playground_url = \"https://play.rust-lang.org/\")]\n"
@@ -17551,7 +17553,7 @@ msgid ""
1755117553
"//! ```\n"
1755217554
"````"
1755317555
msgstr ""
17554-
"````\n"
17556+
"````text\n"
1755517557
"#![doc(html_playground_url = \"https://play.rust-lang.org/\")]\n"
1755617558
"//! ```\n"
1755717559
"//! println!(\"Hello World\");\n"

0 commit comments

Comments
 (0)