diff --git a/po/zh-CN.po b/po/zh-CN.po index 7dc56040c2b3..1986f4d3b432 100644 --- a/po/zh-CN.po +++ b/po/zh-CN.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" "POT-Creation-Date: 2023-10-06T12:36:03-07:00\n" -"PO-Revision-Date: 2023-10-19 16:12+0800\n" +"PO-Revision-Date: 2023-10-21 15:02+0800\n" "Last-Translator: \n" "Language-Team: Language zh-Hans\n" "Language: zh_CN\n" @@ -115,7 +115,7 @@ msgstr "切片" #: src/SUMMARY.md:34 msgid "String vs str" -msgstr "String 和 str" +msgstr "String vs str" #: src/SUMMARY.md:35 src/basic-syntax/functions.md:1 msgid "Functions" @@ -194,11 +194,11 @@ msgstr "类型推导" #: src/SUMMARY.md:55 msgid "static & const" -msgstr "静态与常量" +msgstr "静态变量与常量" #: src/SUMMARY.md:56 src/basic-syntax/scopes-shadowing.md:1 msgid "Scopes and Shadowing" -msgstr "作用域和隐藏 (Shadowing)" +msgstr "作用域和遮蔽(Shadowing)" #: src/SUMMARY.md:57 src/enums.md:1 msgid "Enums" @@ -213,9 +213,8 @@ msgid "Enum Sizes" msgstr "枚举大小" #: src/SUMMARY.md:61 src/control-flow/novel.md:1 -#, fuzzy msgid "Novel Control Flow" -msgstr "控制流" +msgstr "新式控制流" #: src/SUMMARY.md:62 msgid "if let expressions" @@ -252,7 +251,7 @@ msgstr "匹配守卫" #: src/SUMMARY.md:73 src/exercises/day-1/luhn.md:1 #: src/exercises/day-1/solutions-afternoon.md:3 msgid "Luhn Algorithm" -msgstr "Luhn 算法" +msgstr "卢恩算法" #: src/SUMMARY.md:76 msgid "Day 2: Morning" @@ -352,9 +351,8 @@ msgid "Example" msgstr "示例" #: src/SUMMARY.md:107 src/exercises/day-2/book-library.md:1 -#, fuzzy msgid "Storing Books" -msgstr "字符串" +msgstr "书籍存储" #: src/SUMMARY.md:108 src/exercises/day-2/health-statistics.md:1 #: src/exercises/day-2/solutions-morning.md:151 @@ -452,11 +450,11 @@ msgstr "单态化" #: src/SUMMARY.md:140 src/traits.md:1 msgid "Traits" -msgstr "特征" +msgstr "特征(Trait)" #: src/SUMMARY.md:141 src/traits/trait-objects.md:1 msgid "Trait Objects" -msgstr "特征(Trait)对象" +msgstr "特征对象" #: src/SUMMARY.md:142 src/traits/deriving-traits.md:1 msgid "Deriving Traits" @@ -683,11 +681,11 @@ msgstr "与 C 语言交互" #: src/SUMMARY.md:208 msgid "Calling C with Bindgen" -msgstr "使用Bindgen调用C语言" +msgstr "使用 Bindgen 调用 C 语言" #: src/SUMMARY.md:209 msgid "Calling Rust from C" -msgstr "从C语言调用Rust语言" +msgstr "从 C 语言调用 Rust 语言" #: src/SUMMARY.md:210 src/android/interoperability/cpp.md:1 msgid "With C++" @@ -699,7 +697,7 @@ msgstr "与 Java 交互" #: src/SUMMARY.md:215 msgid "Bare Metal: Morning" -msgstr "裸机:上午" +msgstr "裸金属:上午" #: src/SUMMARY.md:220 msgid "no_std" @@ -738,6 +736,7 @@ msgid "The Type State Pattern" msgstr "类型状态模式" #: src/SUMMARY.md:229 +#, fuzzy msgid "embedded-hal" msgstr "embedded-hal" @@ -746,8 +745,9 @@ msgid "probe-rs, cargo-embed" msgstr "probe-rs、cargo-embed" #: src/SUMMARY.md:231 src/bare-metal/microcontrollers/debugging.md:1 +#, fuzzy msgid "Debugging" -msgstr "Debugging" +msgstr "调试" #: src/SUMMARY.md:232 src/SUMMARY.md:252 msgid "Other Projects" @@ -760,7 +760,7 @@ msgstr "罗盘" #: src/SUMMARY.md:236 msgid "Bare Metal: Afternoon" -msgstr "裸机:下午" +msgstr "裸金属:下午" #: src/SUMMARY.md:238 msgid "Application Processors" @@ -772,7 +772,7 @@ msgstr "准备使用 Rust" #: src/SUMMARY.md:240 msgid "Inline Assembly" -msgstr "内嵌汇编" +msgstr "内联汇编" #: src/SUMMARY.md:241 msgid "MMIO" @@ -807,9 +807,8 @@ msgid "Using It" msgstr "开始使用" #: src/SUMMARY.md:251 src/bare-metal/aps/exceptions.md:1 -#, fuzzy msgid "Exceptions" -msgstr "函数" +msgstr "异常" #: src/SUMMARY.md:253 msgid "Useful Crates" @@ -845,7 +844,7 @@ msgstr "RTC驱动" #: src/SUMMARY.md:265 msgid "Concurrency: Morning" -msgstr "并发编程:入门篇" +msgstr "并发编程:上午" #: src/SUMMARY.md:270 src/concurrency/threads.md:1 msgid "Threads" @@ -963,9 +962,8 @@ msgid "Async Traits" msgstr "异步特质" #: src/SUMMARY.md:303 src/async/pitfalls/cancellation.md:1 -#, fuzzy msgid "Cancellation" -msgstr "安装" +msgstr "消除" #: src/SUMMARY.md:306 src/exercises/concurrency/chat-app.md:1 #: src/exercises/concurrency/solutions-afternoon.md:95 @@ -982,7 +980,7 @@ msgstr "谢谢!" #: src/SUMMARY.md:314 src/glossary.md:1 msgid "Glossary" -msgstr "" +msgstr "词汇表" #: src/SUMMARY.md:315 msgid "Other Resources" @@ -1070,7 +1068,7 @@ msgid "" "comprehensive-rust/>. If you are reading somewhere else, please check there " "for updates." msgstr "" -"如需查看课程的最新版本,请访问 。如果你是在其他地方阅读,请查看此网址了解是否有更新。" #: src/index.md:15 @@ -1093,19 +1091,19 @@ msgstr "展示常见的 Rust 习语。" #: src/index.md:22 msgid "We call the first three course days Rust Fundamentals." -msgstr "我们将前三天的课程称为`Rust 基础知识`。" +msgstr "我们将前三天的课程称为“Rust 基础知识”。" #: src/index.md:24 msgid "" "Building on this, you're invited to dive into one or more specialized topics:" -msgstr "在此基础上,你可以选择深入学习一个或多个专门的主题:" +msgstr "在此基础上,你可以选择深入学习一个或多个专门的主题:" #: src/index.md:26 msgid "" "[Android](android.md): a half-day course on using Rust for Android platform " "development (AOSP). This includes interoperability with C, C++, and Java." msgstr "" -"[Android](android.md):一个半天的课程,介绍如何在 Android 平台开发中使用 Rust" +"[Android](android.md):为期半天的课程,介绍如何在 Android 平台开发中使用 Rust" "(AOSP)。课程内容包括与 C、C++ 和 Java 的互操作性。" #: src/index.md:28 @@ -1114,8 +1112,8 @@ msgid "" "(embedded) development. Both microcontrollers and application processors are " "covered." msgstr "" -"[Bare-metal](bare-metal.md):为期一天的课程,介绍如何使用 Rust 进行裸机(嵌入" -"式)开发。课程内容涵盖微控制器和应用处理器。" +"[Bare-metal](bare-metal.md):为期一天的课程,介绍如何使用 Rust 进行裸机(嵌入" +"式)开发。课程内容涵盖微控制器和应用处理器。" #: src/index.md:31 msgid "" @@ -1124,9 +1122,9 @@ msgid "" "mutexes) and async/await concurrency (cooperative multitasking using " "futures)." msgstr "" -"[并发](concurrency.md):一天的课程,介绍 Rust 中的并发性。我们将涵盖传统并发" -"(使用线程和互斥锁进行抢占式调度)和 async/await 并发(使用 futures 进行协作式多" -"任务处理)。" +"[并发](concurrency.md):为期一天的课程,介绍 Rust 中的并发性。我们将涵盖传统" +"并发(使用线程和互斥锁进行抢占式调度)和 async/await 并发(使用 futures 进行" +"协作式多任务处理)。" #: src/index.md:37 msgid "Non-Goals" @@ -1198,10 +1196,10 @@ msgid "" "The downside of longer session is that people can become very tired after 6 " "full hours of class in the afternoon." msgstr "" -"上课时间通常是从上午 10:00 到下午 4:00,中间有 1 小时的午餐休息时间。这样,上午" -"和下午各留了 2.5 小时的上课时间。请注意,这仅是建议:您也可以上午上课 3 小时,让" -"学员有更多的时间进行练习。上课时间较长的缺点是,学员上了整整 6 小时的课,到了下" -"午可能会非常疲倦。" +"上课时间通常是从上午 10:00 到下午 4:00,中间有 1 小时的午餐休息时间。这样,上" +"午和下午各留了 2.5 小时的上课时间。请注意,这仅是建议:您也可以上午上课 3 小" +"时,让学员有更多的时间进行练习。上课时间较长的缺点是,学员上了整整 6 小时的" +"课,到了下午可能会非常疲倦。" #: src/running-the-course.md:16 msgid "Before you run the course, you will want to:" @@ -1296,7 +1294,7 @@ msgstr "" #: src/running-the-course/course-structure.md:5 msgid "Rust Fundamentals" -msgstr "Rust 二进制文件" +msgstr "Rust 基础知识" #: src/running-the-course/course-structure.md:7 msgid "" @@ -1308,19 +1306,17 @@ msgstr "" #: src/running-the-course/course-structure.md:10 msgid "Day 1: Basic Rust, syntax, control flow, creating and consuming values." -msgstr "第 1 天:Rust 基础知识、语法、控制流、创建和使用值。" +msgstr "第 1 天:Rust 基础知识、语法、控制流、创建及使用值。" #: src/running-the-course/course-structure.md:11 -#, fuzzy msgid "" "Day 2: Memory management, ownership, compound data types, and the standard " "library." -msgstr "第 2 天:复合数据类型、模式匹配和标准库。" +msgstr "第 2 天:内存管理、所有权、复合数据类类型及标准库。" #: src/running-the-course/course-structure.md:12 -#, fuzzy msgid "Day 3: Generics, traits, error handling, testing, and unsafe Rust." -msgstr "第 3 天:trait 和泛型、错误处理、测试和不安全 Rust。" +msgstr "第 3 天:泛型、trait、错误处理、测试和不安全 Rust。" #: src/running-the-course/course-structure.md:14 msgid "Deep Dives" @@ -1333,18 +1329,16 @@ msgid "" msgstr "除了为期 3 天的“Rust 基础知识”课程外,我们还推出了一些专题课程:" #: src/running-the-course/course-structure.md:19 -#, fuzzy msgid "Rust in Android" -msgstr "欢迎来到Android 中的Rust" +msgstr "Android 中的 Rust" #: src/running-the-course/course-structure.md:21 -#, fuzzy msgid "" "The [Rust in Android](../android.md) deep dive is a half-day course on using " "Rust for Android platform development. This includes interoperability with " "C, C++, and Java." msgstr "" -"`[深入探究 Android](../android.md)`课程为期半天,旨在介绍如何使用 Rust 进行 " +"`[深入探究 Android](../android.md)`课程为期半天,旨在介绍如何使用 Rust 进行 " "Android 平台开发。其中包括与 C、C++ 和 Java 的互操作性。" #: src/running-the-course/course-structure.md:25 @@ -1371,19 +1365,17 @@ msgstr "" "能在你手动运行时正确执行。" #: src/running-the-course/course-structure.md:37 -#, fuzzy msgid "Bare-Metal Rust" -msgstr "裸机" +msgstr "裸金属 Rust" #: src/running-the-course/course-structure.md:39 -#, fuzzy msgid "" "The [Bare-Metal Rust](../bare-metal.md) deep dive is a full day class on " "using Rust for bare-metal (embedded) development. Both microcontrollers and " "application processors are covered." msgstr "" -"`[深入探究裸机](../bare-metal.md)`课程为期一天,旨在介绍如何使用 Rust 进行裸机" -"(嵌入式)开发。其中涵盖了微控制器和应用 处理器。" +"`[深入探究裸金属 Rust](../bare-metal.md)`课程为期一天,旨在介绍如何使用 Rust " +"进行裸金属(嵌入式)开发。其中涵盖了微控制器和应用处理器。" #: src/running-the-course/course-structure.md:43 msgid "" @@ -1398,14 +1390,14 @@ msgstr "" #: src/running-the-course/course-structure.md:48 msgid "Concurrency in Rust" -msgstr "欢迎了解 Rust 中的并发" +msgstr "Rust 中的并发" #: src/running-the-course/course-structure.md:50 msgid "" "The [Concurrency in Rust](../concurrency.md) deep dive is a full day class " "on classical as well as `async`/`await` concurrency." msgstr "" -"[深入探究并发](../concurrency.md)课程为期一天,旨在介绍传统并发和 `async`/" +"[深入探究并发](../concurrency.md)课程为期一天,旨在介绍传统并发和 `async`/" "`await` 并发。" #: src/running-the-course/course-structure.md:53 @@ -1476,7 +1468,7 @@ msgid "" "com/hugojacob), [@joaovicmendes](https://github.com/joaovicmendes), and " "[@henrif75](https://github.com/henrif75)." msgstr "" -"[巴西葡萄牙语版本](https://google.github.io/comprehensive-rust/pt-BR/)译者:" +"[巴西葡萄牙语版本](https://google.github.io/comprehensive-rust/pt-BR/) 译者:" "[@rastringer](https://github.com/rastringer)、[@hugojacob](https://github." "com/hugojacob)、[@joaovicmendes](https://github.com/joaovicmendes) 和 " "[@henrif75](https://github.com/henrif75)。" @@ -1487,7 +1479,7 @@ msgid "" "(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp), and " "[@jooyunghan](https://github.com/jooyunghan)." msgstr "" -"[韩语版本](https://google.github.io/comprehensive-rust/ko/)译者:[@keispace]" +"[韩语版本](https://google.github.io/comprehensive-rust/ko/) 译者:[@keispace]" "(https://github.com/keispace)、[@jiyongp](https://github.com/jiyongp) 和 " "[@jooyunghan](https://github.com/jooyunghan)。" @@ -1496,6 +1488,8 @@ msgid "" "[Spanish](https://google.github.io/comprehensive-rust/es/) by [@deavid]" "(https://github.com/deavid)." msgstr "" +"[西班牙语版本](https://google.github.io/comprehensive-rust/es/) 译者:" +"[@deavid](https://github.com/deavid)。" #: src/running-the-course/translations.md:10 msgid "" @@ -1517,7 +1511,7 @@ msgid "" "[Bengali](https://google.github.io/comprehensive-rust/bn/) by [@raselmandol]" "(https://github.com/raselmandol)." msgstr "" -"[孟加拉语版本](https://google.github.io/comprehensive-rust/bn/)译者:" +"[孟加拉语版本](https://google.github.io/comprehensive-rust/bn/) 译者:" "[@raselmandol](https://github.com/raselmandol)。" #: src/running-the-course/translations.md:18 @@ -1551,7 +1545,7 @@ msgid "" "[French](https://google.github.io/comprehensive-rust/fr/) by [@KookaS]" "(https://github.com/KookaS) and [@vcaen](https://github.com/vcaen)." msgstr "" -"[法语版本](https://google.github.io/comprehensive-rust/fr/)译者:[@KookaS]" +"[法语版本](https://google.github.io/comprehensive-rust/fr/) 译者:[@KookaS]" "(https://github.com/KookaS) 和 [@vcaen](https://github.com/vcaen)。" #: src/running-the-course/translations.md:21 @@ -1559,7 +1553,7 @@ msgid "" "[German](https://google.github.io/comprehensive-rust/de/) by [@Throvn]" "(https://github.com/Throvn) and [@ronaldfw](https://github.com/ronaldfw)." msgstr "" -"[德语版本](https://google.github.io/comprehensive-rust/de/)译者:[@Throvn]" +"[德语版本](https://google.github.io/comprehensive-rust/de/) 译者:[@Throvn]" "(https://github.com/Throvn) 和 [@ronaldfw](https://github.com/ronaldfw)。" #: src/running-the-course/translations.md:22 @@ -1568,8 +1562,8 @@ msgid "" "(https://github.com/CoinEZ) and [@momotaro1105](https://github.com/" "momotaro1105)." msgstr "" -"[日语版本](https://google.github.io/comprehensive-rust/ja/)译者:[@CoinEZ-JPN]" -"(https://github.com/CoinEZ) 和 [@momotaro1105](https://github.com/" +"[日语版本](https://google.github.io/comprehensive-rust/ja/) 译者:[@CoinEZ-" +"JPN](https://github.com/CoinEZ) 和 [@momotaro1105](https://github.com/" "momotaro1105)。" #: src/running-the-course/translations.md:24 @@ -1579,9 +1573,9 @@ msgid "" "get going. Translations are coordinated on the [issue tracker](https://" "github.com/google/comprehensive-rust/issues/282)." msgstr "" -"如果你想帮助我们,请参阅[我们的说明](htts://github.com/google/comprehensive-" -"rust/blob/main/TRANSLATIONS.md),了解如何开始翻译。翻译工作将通过[问题跟踪器]" -"(https://github.com/google/comprehensive-rust/issues/282)." +"如果你想帮助我们,请参阅[我们的说明](htts://github.com/google/comprehensive-" +"rust/blob/main/TRANSLATIONS.md),了解如何开始翻译。翻译工作将通过[问题跟踪器]" +"(https://github.com/google/comprehensive-rust/issues/282)跟踪。" #: src/cargo.md:3 msgid "" @@ -1592,9 +1586,9 @@ msgid "" "training." msgstr "" "开始了解 Rust 后,你很快就会遇到 [Cargo](https://doc.rust-lang.org/cargo/)," -"这是 Rust 生态系统中 用于构建和运行 Rust 应用的标准工具。在这里,我们希望 简" -"要介绍一下什么是 Cargo,它如何融入更广泛的生态系统, 以及我们如何在本培训中合" -"理利用 Cargo。" +"这是 Rust 生态系统中用于构建和运行 Rust 应用的标准工具。在这里,我们想简要介" +"绍一下什么是 Cargo、它如何融入更广泛的生态系统, 以及我们如何在本培训中合理利" +"用 Cargo。" #: src/cargo.md:8 msgid "Installation" @@ -1611,7 +1605,7 @@ msgid "" "use to install to different compiler versions." msgstr "" "这将为你提供 Cargo 构建工具 (`cargo`)和 Rust 编译器 (`rustc`)。你还将获得 " -"`rustup`,这是一个命令行实用程序,你可以用它来安装不同的编译器版本。" +"`rustup`,这是一个命令行实用程序,你可以用它来安装不同的编译器版本。" #: src/cargo.md:14 msgid "" @@ -1623,8 +1617,8 @@ msgid "" "analyzer.github.io/manual.html#vimneovim), and many others. There is also a " "different IDE available called [RustRover](https://www.jetbrains.com/rust/)." msgstr "" -"安装Rust之后,你应当配置你的编辑器或IDE以开始使用Rust。大多数编辑器使用[rust-" -"analyzer](https://rust-analyzer.github.io/)以达成此目的。它为[VS Code]" +"安装Rust之后,你应当配置你的编辑器或 IDE 以开始使用 Rust。大多数编辑器使用" +"[rust-analyzer](https://rust-analyzer.github.io/)以达成此目的。它为[VS Code]" "(https://code.visualstudio.com/)、[Emacs](https://rust-analyzer.github.io/" "manual.html#emacs)、[Vim/Neovim](https://rust-analyzer.github.io/manual." "html#vimneovim)及其他许多编辑器提供了自动补全及定义跳转的功能。同样也可以用一" @@ -1637,9 +1631,9 @@ msgid "" "gets you an outdated rust version and may lead to unexpected behavior. The " "command would be:" msgstr "" -"在 Debian/Ubuntu 上,你也可以通过 `apt` 安装 Cargo、Rust 源代码和 [Rust 格式设" -"置工具](https://github.com/rust-lang/rustfmt)。但是,这样会得到一个过时的 " -"Rust 版本,可能会导致意外的行为。命令如下:" +"在 Debian/Ubuntu 上,你也可以通过 `apt` 安装 Cargo、Rust 源代码和 [Rust 格式" +"化工具](https://github.com/rust-lang/rustfmt)。但是,这样会得到一个过时的 " +"Rust 版本,这可能会导致意外的行为。命令如下:" #: src/cargo/rust-ecosystem.md:1 msgid "The Rust Ecosystem" @@ -1654,7 +1648,7 @@ msgstr "Rust 生态系统由许多工具组成,其中的主要工具包括:" msgid "" "`rustc`: the Rust compiler which turns `.rs` files into binaries and other " "intermediate formats." -msgstr "`rustc`:Rust 编译器,可将 `.rs` 文件转换为二进制文件和其他 中间格式。" +msgstr "`rustc`:Rust 编译器,可将 `.rs` 文件转换为二进制文件和其他中间格式。" #: src/cargo/rust-ecosystem.md:8 msgid "" @@ -1663,9 +1657,9 @@ msgid "" "pass them to `rustc` when building your project. Cargo also comes with a " "built-in test runner which is used to execute unit tests." msgstr "" -"`cargo`:Rust 依赖项管理器和构建工具。Cargo 知道如何 下载托管在 上的依赖项,并在构建项目时将它们 传递给 `rustc`。Cargo 还附带一个内" -"置的 测试运行程序,用于执行单元测试。" +"`cargo`:Rust 依赖项管理器和构建工具。Cargo 知道如何下载托管在 上的依赖项,并在构建项目时将它们传递给 `rustc`。Cargo 还附带一个内" +"置的测试运行程序,用于执行单元测试。" #: src/cargo/rust-ecosystem.md:13 msgid "" @@ -1675,9 +1669,9 @@ msgid "" "standard library. You can have multiple versions of Rust installed at once " "and `rustup` will let you switch between them as needed." msgstr "" -"`rustup`:Rust 工具链安装程序和更新程序。发布新版本 Rust 时,此工具用于 安装" -"并更新 `rustc` 和 `cargo`。 此外,`rustup` 还可以下载标准 库的文档。你可以同" -"时安装多个版本的 Rust,并且 `rustup` 可让你根据需要在这些版本之间切换。" +"`rustup`:Rust 工具链安装程序和更新程序。发布新版本 Rust 时,此工具用于安装并" +"更新 `rustc` 和 `cargo`。 此外,`rustup` 还可以下载标准库的文档。你可以同时安" +"装多个版本的 Rust,并且 `rustup` 可让你根据需要在这些版本之间切换。" #: src/cargo/rust-ecosystem.md:21 src/hello-world.md:25 #: src/hello-world/small-example.md:27 src/why-rust/runtime.md:10 @@ -1697,19 +1691,19 @@ msgid "" "weeks. New releases maintain backwards compatibility with old releases --- " "plus they enable new functionality." msgstr "" -"Rust 有一个快速发布时间表,每六周就会发布一次 新版本。新版本保持与 旧版本的向" +"Rust 有一个快速发布时间表,每六周就会发布一次 新版本。新版本保持与旧版本的向" "后兼容性,还添加了新功能。" #: src/cargo/rust-ecosystem.md:27 msgid "" "There are three release channels: \"stable\", \"beta\", and \"nightly\"." -msgstr "共有三个发布阶段:“稳定版”“Beta 版”和“夜间版”。" +msgstr "共有三个发布阶段:“稳定版”、“Beta 版”和“夜间版”。" #: src/cargo/rust-ecosystem.md:29 msgid "" "New features are being tested on \"nightly\", \"beta\" is what becomes " "\"stable\" every six weeks." -msgstr "我们会在“夜间版”上测试新功能,每六周将“Beta 版”升级为 “稳定版”。" +msgstr "我们会在“夜间版”上测试新功能,每六周将“Beta 版”升级为“稳定版”。" #: src/cargo/rust-ecosystem.md:32 msgid "" @@ -1717,21 +1711,21 @@ msgid "" "rust-lang.org/cargo/reference/registries.html), git, folders, and more." msgstr "" "您也可以通过备用的[注册数据库](https://doc.rust-lang.org/cargo/reference/" -"registries.html)、git、文件夹等资源来解析依赖项。" +"registries.html)、git及文件夹等资源来解析依赖项。" #: src/cargo/rust-ecosystem.md:34 msgid "" "Rust also has [editions](https://doc.rust-lang.org/edition-guide/): the " "current edition is Rust 2021. Previous editions were Rust 2015 and Rust 2018." msgstr "" -"Rust 也有三个\\[版本\\]:当前版本是 Rust 2021。之前的 版本是 Rust 2015 和 " +"Rust 也有三个\\[版本\\]:当前版本是 Rust 2021。之前的版本是 Rust 2015 和 " "Rust 2018。" #: src/cargo/rust-ecosystem.md:37 msgid "" "The editions are allowed to make backwards incompatible changes to the " "language." -msgstr "这些版本支持对语言进行向后不兼容的 更改。" +msgstr "这些版本支持对语言进行向后不兼容的更改。" #: src/cargo/rust-ecosystem.md:40 msgid "" @@ -1745,7 +1739,7 @@ msgstr "" msgid "" "To avoid splitting the ecosystem, Rust compilers can mix code written for " "different editions." -msgstr "为免分割生态系统,Rust 编译器可以混合使用 为不同版本编写的代码。" +msgstr "为免分割生态系统,Rust 编译器可以混合使用为不同版本编写的代码。" #: src/cargo/rust-ecosystem.md:46 msgid "" @@ -1810,7 +1804,7 @@ msgid "" "which can be executed through your browser. This makes the setup much easier " "and ensures a consistent experience for everyone." msgstr "" -"在本培训中,我们将主要通过示例 探索 Rust 语言,这些示例可通过浏览器执行。这能" +"在本培训中,我们将主要通过示例探索 Rust 语言,这些示例可通过浏览器执行。这能" "大大简化设置过程, 并确保所有人都能获得一致的体验。" #: src/cargo/code-samples.md:7 @@ -1819,7 +1813,7 @@ msgid "" "the exercises. On the last day, we will do a larger exercise which shows you " "how to work with dependencies and for that you need Cargo." msgstr "" -"我们仍然建议你安装 Cargo:它有助于你更轻松地完成 练习。在最后一天,我们要做一" +"我们仍然建议你安装 Cargo:它有助于你更轻松地完成练习。在最后一天,我们要做一" "个更大的练习, 向你展示如何使用依赖项,因此你需要安装 Cargo。" #: src/cargo/code-samples.md:11 @@ -1842,7 +1836,7 @@ msgstr "" #: src/cargo/code-samples.md:19 msgid "You can use " -msgstr "当文本框为 焦点时,你可以使用 " +msgstr "当文本框为焦点时,你可以使用" #: src/cargo/code-samples.md:19 #, fuzzy @@ -1854,7 +1848,7 @@ msgid "" "Most code samples are editable like shown above. A few code samples are not " "editable for various reasons:" msgstr "" -"大多数代码示例都可修改(如上图所示)。少数代码示例 可能会因各种原因而不可修" +"大多数代码示例都可修改(如上图所示)。少数代码示例可能会因各种原因而不可修" "改:" #: src/cargo/code-samples.md:27 @@ -1862,7 +1856,7 @@ msgid "" "The embedded playgrounds cannot execute unit tests. Copy-paste the code and " "open it in the real Playground to demonstrate unit tests." msgstr "" -"嵌入式 Playground 无法执行单元测试。将代码复制并粘贴 到实际 Playground 中,以" +"嵌入式 Playground 无法执行单元测试。将代码复制并粘贴到实际 Playground 中,以" "演示单元测试。" #: src/cargo/code-samples.md:30 @@ -1871,7 +1865,7 @@ msgid "" "the page! This is the reason that the students should solve the exercises " "using a local Rust installation or via the Playground." msgstr "" -"嵌入式 Playground 会在你离开页面后立即 丢失其状态!正因如此,学员应使用本地安" +"嵌入式 Playground 会在你离开页面后立即丢失其状态!正因如此,学员应使用本地安" "装的 Rust 或通过 Playground 解题。" #: src/cargo/running-locally.md:1 @@ -1887,15 +1881,15 @@ msgid "" "latest stable Rust release has these version numbers:" msgstr "" "如果你想在自己的系统上对代码进行实验, 则需要先安装 Rust。为此,请按照 [Rust " -"图书中的 说明](https://doc.rust-lang.org/book/ch01-01-installation.html)操" -"作。这应会为你提供一个有效的 `rustc` 和 `cargo`。在撰写 本文时,最新的 Rust " -"稳定版具有以下版本号:" +"图书中的说明](https://doc.rust-lang.org/book/ch01-01-installation.html)操作。" +"这应会为你提供一个有效的 `rustc` 和 `cargo`。在撰写本文时,最新的 Rust 稳定版" +"具有以下版本号:" #: src/cargo/running-locally.md:15 msgid "" "You can use any later version too since Rust maintains backwards " "compatibility." -msgstr "您也可以使用任何更高版本,因为 Rust 保持向后兼容性。" +msgstr "您也可以使用任何更高版本,因为 Rust 保持向后兼容性。" #: src/cargo/running-locally.md:17 msgid "" @@ -1978,30 +1972,29 @@ msgid "Welcome to Day 1" msgstr "欢迎来到第一天" #: src/welcome-day-1.md:3 -#, fuzzy msgid "" "This is the first day of Rust Fundamentals. We will cover a lot of ground " "today:" -msgstr "现在是学习 Comprehensive Rust 的第一天。今天我们会涉及很多内容:" +msgstr "今天是学习 Comprehensive Rust 的第一天。我们会涉及很多内容:" #: src/welcome-day-1.md:6 msgid "" "Basic Rust syntax: variables, scalar and compound types, enums, structs, " "references, functions, and methods." msgstr "" -"Rust 基本语法:变量,标量(scalar)和复合(compound)类型,枚举(enum),结构" -"体(struct),引用,函数和方法。" +"Rust 基本语法:变量、标量(scalar)和复合(compound)类型、枚举(Enum)、结构" +"体(struct)、引用、函数和方法。" #: src/welcome-day-1.md:9 msgid "" "Control flow constructs: `if`, `if let`, `while`, `while let`, `break`, and " "`continue`." msgstr "" -"控制流的构造: `if`, `if let`, `while`, `while let`, `break`, 和 `continue`。" +"控制流的构造:`if`、`if let`、`while`、`while let`、`break` 和 `continue`。" #: src/welcome-day-1.md:12 msgid "Pattern matching: destructuring enums, structs, and arrays." -msgstr "模式匹配: 解构枚举, 结构体和数组(array)。" +msgstr "模式匹配:解构枚举、结构体和数组(array)。" #: src/welcome-day-1.md:16 msgid "Please remind the students that:" @@ -2028,13 +2021,13 @@ msgid "" "communication." msgstr "" "作为讲师,你应该尽量保证讨论话题的相关性,例如,讨论围绕Rust是如何做某些事" -"情,而不是其他的语言如何如何。 这个平衡点不容易找到,但是尽量倾向于允许 讨" -"论,因为讨论比起单方面的灌输更有利于让大家投入。" +"情,而不是其他的语言如何如何。 这个平衡点不容易找到,但是尽量倾向于允许讨论," +"因为讨论比起单方面的灌输更有利于让大家投入。" #: src/welcome-day-1.md:24 msgid "" "The questions will likely mean that we talk about things ahead of the slides." -msgstr "有些问题会导致我们提前谈到后面的内容" +msgstr "有些问题会导致我们提前谈到后面的内容。" #: src/welcome-day-1.md:25 msgid "" @@ -2042,8 +2035,8 @@ msgid "" "Remember that the slides are just a support and you are free to skip them as " "you like." msgstr "" -"这完全没有问题! 重复是学习的一个重要方法。请记得 这些幻灯片只是一个辅助,你可" -"以选择性地跳过。" +"这完全没有问题!重复是学习的一个重要方法。请记住,这些幻灯片只是一种辅助,你" +"可以选择性地跳过。" #: src/welcome-day-1.md:29 msgid "" @@ -2083,12 +2076,12 @@ msgid "" "Rust is a new programming language which had its [1.0 release in 2015]" "(https://blog.rust-lang.org/2015/05/15/Rust-1.0.html):" msgstr "" -"Rust 是一种新的编程语言,它的[1.0 版本于 2015 年发布](https://blog.rust-lang." +"Rust 是一门新的编程语言,它的[1.0 版本于 2015 年发布](https://blog.rust-lang." "org/2015/05/15/Rust-1.0.html):" #: src/welcome-day-1/what-is-rust.md:5 msgid "Rust is a statically compiled language in a similar role as C++" -msgstr "Rust 是一种静态编译语言,其功能定位与 C++ 相似" +msgstr "Rust 是一门静态编译语言,其功能定位与 C++ 相似" #: src/welcome-day-1/what-is-rust.md:6 msgid "`rustc` uses LLVM as its backend." @@ -2104,11 +2097,11 @@ msgstr "" #: src/welcome-day-1/what-is-rust.md:9 msgid "x86, ARM, WebAssembly, ..." -msgstr "x86, ARM, WebAssembly, ..." +msgstr "x86、ARM、WebAssembly......" #: src/welcome-day-1/what-is-rust.md:10 msgid "Linux, Mac, Windows, ..." -msgstr "Linux, Mac, Windows, ..." +msgstr "Linux、Mac、Windows......" #: src/welcome-day-1/what-is-rust.md:11 msgid "Rust is used for a wide range of devices:" @@ -2147,10 +2140,9 @@ msgid "High level of control." msgstr "高度的控制能力。" #: src/welcome-day-1/what-is-rust.md:25 -#, fuzzy msgid "" "Can be scaled down to very constrained devices such as microcontrollers." -msgstr "能够在资源极度有限的设备(如手机)上运行。" +msgstr "能够在资源匮乏的设备(如手机)上运行。" #: src/welcome-day-1/what-is-rust.md:26 msgid "Has no runtime or garbage collection." @@ -2194,7 +2186,7 @@ msgstr "像 C 和 C++ 一样,块由花括号分隔。" #: src/hello-world.md:16 msgid "The `main` function is the entry point of the program." -msgstr "`main` 函数是程序的入口。" +msgstr "`main` 函数是程序的入口点。" #: src/hello-world.md:17 msgid "Rust has hygienic macros, `println!` is an example of this." @@ -2225,7 +2217,7 @@ msgstr "" #: src/hello-world.md:31 msgid "Rust is modern with full support for things like Unicode." -msgstr "Rust 是一种现代编程语言,它完全支持 Unicode 等特性。" +msgstr "Rust 是一门现代编程语言,它完全支持 Unicode 等特性。" #: src/hello-world.md:33 msgid "" @@ -2242,9 +2234,9 @@ msgid "" "hygienic](https://veykril.github.io/tlborm/decl-macros/minutiae/hygiene." "html)." msgstr "" -"宏是“卫生的”意味着它们不会意外地捕获它们所在作用域中的标识符。Rust 的宏实际上" -"只是[部分卫生](https://veykril.github.io/tlborm/decl-macros/minutiae/hygiene." -"html)。" +"宏是“卫生的”,这意味着它们不会意外地捕获它们所在作用域中的标识符。实际上," +"Rust 的宏只是[部分卫生](https://veykril.github.io/tlborm/decl-macros/" +"minutiae/hygiene.html)。" #: src/hello-world.md:40 msgid "" @@ -2259,7 +2251,7 @@ msgstr "" #: src/hello-world/small-example.md:3 msgid "Here is a small example program in Rust:" -msgstr "以下是一个简短的 Rust 示例程序" +msgstr "以下是一个简短的 Rust 示例程序:" #: src/hello-world/small-example.md:5 msgid "" @@ -2343,7 +2335,7 @@ msgid "" "In a shell `rustup doc std::fmt` will open a browser on the local std::fmt " "documentation" msgstr "" -"在 shell 中,运行“rustup doc std::fmt”会在浏览器中打开本地 std::fmt 文档" +"在 shell 中,运行 `rustup doc std::fmt` 会在浏览器中打开本地 std::fmt 文档" #: src/why-rust.md:3 msgid "Some unique selling points of Rust:" @@ -2374,9 +2366,9 @@ msgid "" "have the memory unsafety issues. In addition, you get a modern language with " "constructs like pattern matching and built-in dependency management." msgstr "" -"使用过 C 或 C++:Rust 利用\"借用检查\"消除了一类 _运行时错误_ 。你可以达到堪" -"比 C 和 C++ 的性能,而没有内存不安全的问题。并且你还可以得到些现代的语言构" -"造,比如模式匹配和内置依赖管理。" +"使用过 C 或 C++:Rust 利用借用检查消除了一类 _运行时错误_ 。你可以达到堪比 C " +"和 C++ 的性能,而没有内存不安全的问题。并且你还可以得到些现代的语言构造,比如" +"模式匹配和内置依赖管理。" #: src/why-rust.md:19 msgid "" @@ -2385,13 +2377,13 @@ msgid "" "addition you get fast and predictable performance like C and C++ (no garbage " "collector) as well as access to low-level hardware (should you need it)" msgstr "" -"使用过 Java, Go, Python, JavaScript...:你可以得到和这些语言相同的内存安全特" -"性,并拥有类似的使用高级语言的感受。同时你可以得到类似 C 和 C++ 的高速且可预" -"测的执行性能(无垃圾回收机制),以及在需要时对底层硬件的访问。" +"使用过 Java、Go、Python、JavaScript......:你可以得到和这些语言相同的内存安全" +"特性,并拥有类似的使用高级语言的感受。同时你可以得到类似 C 和 C++ 的高速且可" +"预测的执行性能(无垃圾回收机制),以及在需要时对底层硬件的访问。" #: src/why-rust/an-example-in-c.md:4 msgid "Let's consider the following \"minimum wrong example\" program in C:" -msgstr "让我们查看以下C语言的 \"最小错误示例\" 程序:" +msgstr "让我们查看以下 C 语言的“最小错误示例”程序:" #: src/why-rust/an-example-in-c.md:6 msgid "" @@ -2440,13 +2432,13 @@ msgstr "" #: src/why-rust/an-example-in-c.md:48 msgid "How many bugs do you spot?" -msgstr "你发现了多少bug?" +msgstr "你发现了多少 bug?" #: src/why-rust/an-example-in-c.md:52 msgid "" "Despite just 29 lines of code, this C example contains serious bugs in at " "least 11:" -msgstr "尽管该C语言示例仅有29行代码,但它却包含了至少11个严重bug:" +msgstr "尽管该 C 语言示例仅有29行代码,但它却包含了至少11个严重 bug:" #: src/why-rust/an-example-in-c.md:54 msgid "Assignment `=` instead of equality comparison `==` (line 28)" @@ -2454,7 +2446,7 @@ msgstr "使用赋值 `=` 而非判断相等 `==`(第28行)" #: src/why-rust/an-example-in-c.md:55 msgid "Excess argument to `printf` (line 23)" -msgstr "`printf`有多余参数(第23行)" +msgstr "`printf` 有多余参数(第23行)" #: src/why-rust/an-example-in-c.md:56 msgid "File descriptor leak (after line 26)" @@ -2462,21 +2454,21 @@ msgstr "文件描述符泄露(第26行之后)" #: src/why-rust/an-example-in-c.md:57 msgid "Forgotten braces in multi-line `if` (line 22)" -msgstr "多行`if`语句缺少花括号(第22行)" +msgstr "多行 `if` 语句缺少花括号(第22行)" #: src/why-rust/an-example-in-c.md:58 msgid "Forgotten `break` in a `switch` statement (line 32)" -msgstr "`switch`语句忘记添加`break`(第32行)" +msgstr "`switch` 语句忘记添加 `break`(第32行)" #: src/why-rust/an-example-in-c.md:59 msgid "" "Forgotten NUL-termination of the `buf` string, leading to a buffer overflow " "(line 29)" -msgstr "`buf`字符串忘记NUL终止符,从而导致缓冲区溢出(第29行)" +msgstr "`buf` 字符串忘记NUL终止符,从而导致缓冲区溢出(第29行)" #: src/why-rust/an-example-in-c.md:60 msgid "Memory leak by not freeing the `malloc`\\-allocated buffer (line 21)" -msgstr "未释放由`malloc`分配的缓冲区,从而导致内存泄漏(第21行)" +msgstr "未释放由 `malloc` 分配的缓冲区,从而导致内存泄漏(第21行)" #: src/why-rust/an-example-in-c.md:61 msgid "Out-of-bounds access (line 17)" @@ -2484,11 +2476,11 @@ msgstr "越界访问(第17行)" #: src/why-rust/an-example-in-c.md:62 msgid "Unchecked cases in the `switch` statement (line 11)" -msgstr "`switch`语句存在未检查的情况(第11行)" +msgstr "`switch` 语句存在未检查的情况(第11行)" #: src/why-rust/an-example-in-c.md:63 msgid "Unchecked return values of `stat` and `fopen` (lines 18 and 26)" -msgstr "`stat`和`fopen`存在未检查的返回值(第18行及第26行)" +msgstr "`stat` 和 `fopen` 存在未检查的返回值(第18行及第26行)" #: src/why-rust/an-example-in-c.md:65 msgid "" @@ -2496,7 +2488,7 @@ msgid "" "No, surprisingly this code compiles warning-free at the default warning " "level, even in the latest GCC version (13.2 as of writing)." msgstr "" -"_即使对于C语言编译器,这些bug难道不应该是显而易见的吗?_ \n" +"_即使对于 C 语言编译器,这些bug难道不应该是显而易见的吗?_ \n" "惊人的是,即便使用最新版本的GCC(截至撰文时为13.2),在默认警告等级下编译代码" "时也不出现任何警告。" @@ -2523,7 +2515,7 @@ msgid "" "Forgotten braces in multi-line `if`: [The Apple goto fail vulnerability]" "(https://dwheeler.com/essays/apple-goto-fail.html)" msgstr "" -"多行`if`语句缺少花括号:[Apple·goto失败漏洞](https://dwheeler.com/essays/" +"多行 `if` 语句缺少花括号:[Apple goto失败漏洞](https://dwheeler.com/essays/" "apple-goto-fail.html)" #: src/why-rust/an-example-in-c.md:73 @@ -2532,8 +2524,8 @@ msgid "" "(https://nakedsecurity.sophos.com/2012/05/21/anatomy-of-a-security-hole-the-" "break-that-broke-sudo)" msgstr "" -"`switch`语句忘记添加`break`:[破坏sudo的break](https://nakedsecurity.sophos." -"com/2012/05/21/anatomy-of-a-security-hole-the-break-that-broke-sudo)" +"`switch` 语句忘记添加 `break`:[破坏sudo的break](https://nakedsecurity." +"sophos.com/2012/05/21/anatomy-of-a-security-hole-the-break-that-broke-sudo)" #: src/why-rust/an-example-in-c.md:75 msgid "" @@ -2545,7 +2537,7 @@ msgstr "" #: src/why-rust/an-example-in-c.md:78 msgid "Assignments inside an `if` clause are not supported." -msgstr "不支持`if`语句内赋值。" +msgstr "不支持 `if` 语句内赋值。" #: src/why-rust/an-example-in-c.md:79 msgid "Format strings are checked at compile-time." @@ -2553,18 +2545,18 @@ msgstr "编译时检查格式化字符串。" #: src/why-rust/an-example-in-c.md:80 msgid "Resources are freed at the end of scope via the `Drop` trait." -msgstr "在作用域末尾,Rust通过`Drop` trait来释放资源。" +msgstr "在作用域末尾,Rust通过 `Drop` trait 来释放资源。" #: src/why-rust/an-example-in-c.md:81 msgid "All `if` clauses require braces." -msgstr "所有`if`语句必须有花括号。" +msgstr "所有 `if` 语句必须有花括号。" #: src/why-rust/an-example-in-c.md:82 msgid "" "`match` (as the Rust equivalent to `switch`) does not fall-through, hence " "you can't accidentally forget a `break`." msgstr "" -"`match`语句(在Rust中相当于`switch`)并不会落空,因此你不会意外忘记一个" +"`match` 语句(在 Rust 中相当于 `switch`)并不会落空,因此你不会意外忘记一个 " "`break`。" #: src/why-rust/an-example-in-c.md:83 @@ -2575,18 +2567,19 @@ msgstr "缓冲区切片自带它们的大小,且不依赖NUL终止符。" msgid "" "Heap-allocated memory is freed via the `Drop` trait when the corresponding " "`Box` leaves the scope." -msgstr "当相关`Box`离开作用域时,Rust通过`Drop` trait释放堆分配内存。" +msgstr "当相关 `Box` 离开作用域时,Rust 通过 `Drop` trait 释放堆分配内存。" #: src/why-rust/an-example-in-c.md:85 msgid "" "Out-of-bounds accesses cause a panic or can be checked via the `get` method " "of a slice." msgstr "" -"越界访问会导致程序严重错误而终止,也可以用`get`方法来检查一个序列是否越界。" +"越界访问会导致程序发生 panic 而终止,也可以用 `get` 方法来检查一个序列是否越" +"界。" #: src/why-rust/an-example-in-c.md:86 msgid "`match` mandates that all cases are handled." -msgstr "`match`语句规定要处理所有情况。" +msgstr "`match` 语句规定要处理所有情况。" #: src/why-rust/an-example-in-c.md:87 msgid "" @@ -2594,8 +2587,8 @@ msgid "" "thereby checked for success. Additionally, the compiler emits a warning if " "you miss to check the return value of a function marked with `#[must_use]`." msgstr "" -"可出错的Rust函数返回的`Result`值需要拆箱并检查是否成功。此外,如果你忽略检查" -"标注为`#[must_use]`的函数的返回值,编译器会发出警告。" +"可出错的 Rust 函数返回的 `Result` 值需要拆箱并检查是否成功。此外,如果你忽略" +"检查标注为 `#[must_use]` 的函数的返回值,编译器会发出警告。" #: src/why-rust/compile-time.md:3 msgid "Static memory management at compile time:" @@ -2639,7 +2632,6 @@ msgid "" msgstr "在(安全的)Rust 中也有可能产生内存泄漏。例如:" #: src/why-rust/compile-time.md:19 -#, fuzzy msgid "" "You can use [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box." "html#method.leak) to leak a pointer. A use of this could be to get runtime-" @@ -2670,7 +2662,8 @@ msgstr "" msgid "" "In fact, some will consider infinitely populating a collection a memory leak " "and Rust does not protect from those." -msgstr "实际上,有人认为无限填充一个集合也是一种内存泄漏,Rust 对此没有保护。" +msgstr "" +"实际上,有人认为无限填充一个集合也是一种内存泄漏,而 Rust 对此没有保护。" #: src/why-rust/compile-time.md:28 msgid "" @@ -2687,12 +2680,10 @@ msgid "Array access is bounds checked." msgstr "数组访问有边界检查。" #: src/why-rust/runtime.md:6 -#, fuzzy msgid "Integer overflow is defined (panic or wrap-around)." -msgstr "整数溢出的行为有明确定义。" +msgstr "整数溢出有明确定义(panic 或回绕)。" #: src/why-rust/runtime.md:12 -#, fuzzy msgid "" "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-" "lang.org/rustc/codegen-options/index.html#overflow-checks) compile-time " @@ -2702,8 +2693,8 @@ msgid "" "build --release`)." msgstr "" "整数溢出的行为由编译时的标志指定。可以选择 panic(一种受控的程序崩溃)或使" -"用“绕回(wrap-around)”语义。默认情况下,使用调试模式编译(`cargo build`)的" -"行为为 panic,使用发布模式编译(`cargo build --release`)的行为为“绕回”。" +"用“回绕(wrap-around)”语义。默认情况下,使用调试模式编译(`cargo build`)的" +"行为为 panic,使用发布模式编译(`cargo build --release`)的行为为“回绕”。" #: src/why-rust/runtime.md:18 msgid "" @@ -2716,9 +2707,8 @@ msgstr "" "`unsafe` 允许你调用 `slice::get_unchecked` 等不做边界检查的函数。" #: src/why-rust/modern.md:3 -#, fuzzy msgid "Rust is built with all the experience gained in the last decades." -msgstr "Rust 建立于过去 40 年来所获得的经验之上。" +msgstr "Rust 建立于过去几十年来所获得的经验之上。" #: src/why-rust/modern.md:5 msgid "Language Features" @@ -2734,7 +2724,7 @@ msgstr "泛型。" #: src/why-rust/modern.md:9 msgid "No overhead FFI." -msgstr "无额外开销外部函数接口(FFI)。" +msgstr "无额外开销的外部函数接口(FFI)。" #: src/why-rust/modern.md:10 msgid "Zero-cost abstractions." @@ -2797,7 +2787,7 @@ msgid "" "and Go. Rust does not come with several things you might consider standard " "and essential:" msgstr "" -"相比 Java, Python 和 Go 等语言,Rust 标准库较为精简。Rust 并没有内置一些你可" +"相比 Java、Python 和 Go 等语言,Rust 标准库较为精简。Rust 并没有内置一些你可" "能认为标准和必要的功能:" #: src/why-rust/modern.md:41 @@ -2851,7 +2841,7 @@ msgstr "" #: src/basic-syntax.md:3 msgid "Much of the Rust syntax will be familiar to you from C, C++ or Java:" -msgstr "Rust 的许多语法与 C, C++ 和 Java 的语法相似" +msgstr "Rust 的许多语法与 C、C++ 和 Java 的语法相似:" #: src/basic-syntax.md:5 msgid "Blocks and scopes are delimited by curly braces." @@ -2886,12 +2876,11 @@ msgstr "有符号整数" #: src/basic-syntax/scalar-types.md:5 msgid "`i8`, `i16`, `i32`, `i64`, `i128`, `isize`" -msgstr "`i8`, `i16`, `i32`, `i64`, `i128`, `isize`" +msgstr "`i8`、`i16`、`i32`、`i64`、`i128`、`isize`" #: src/basic-syntax/scalar-types.md:5 -#, fuzzy msgid "`-10`, `0`, `1_000`, `123_i64`" -msgstr "`-10`, `0`, `1_000`, `123i64`" +msgstr "`-10`、`0`、`1_000`、`123_i64`" #: src/basic-syntax/scalar-types.md:6 msgid "Unsigned integers" @@ -2899,12 +2888,11 @@ msgstr "无符号整数" #: src/basic-syntax/scalar-types.md:6 msgid "`u8`, `u16`, `u32`, `u64`, `u128`, `usize`" -msgstr "`u8`, `u16`, `u32`, `u64`, `u128`, `usize`" +msgstr "`u8`、`u16`、`u32`、`u64`、`u128`、`usize`" #: src/basic-syntax/scalar-types.md:6 -#, fuzzy msgid "`0`, `123`, `10_u16`" -msgstr "`0`, `123`, `10u16`" +msgstr "`0`、`123`、`10_u16`" #: src/basic-syntax/scalar-types.md:7 msgid "Floating point numbers" @@ -2912,12 +2900,11 @@ msgstr "浮点数" #: src/basic-syntax/scalar-types.md:7 msgid "`f32`, `f64`" -msgstr "`f32`, `f64`" +msgstr "`f32`、`f64`" #: src/basic-syntax/scalar-types.md:7 -#, fuzzy msgid "`3.14`, `-10.0e20`, `2_f32`" -msgstr "`3.14`, `-10.0e20`, `2f32`" +msgstr "`3.14`、`-10.0e20`、`2_f32`" #: src/basic-syntax/scalar-types.md:8 msgid "Strings" @@ -2929,7 +2916,7 @@ msgstr "`&str`" #: src/basic-syntax/scalar-types.md:8 msgid "`\"foo\"`, `\"two\\nlines\"`" -msgstr "`\"foo\"`, `\"two\\nlines\"`" +msgstr "`\"foo\"`、`“两\\n行”`" #: src/basic-syntax/scalar-types.md:9 msgid "Unicode scalar values" @@ -2941,7 +2928,7 @@ msgstr "`char`" #: src/basic-syntax/scalar-types.md:9 msgid "`'a'`, `'α'`, `'∞'`" -msgstr "`'a'`, `'α'`, `'∞'`" +msgstr "`'a'`、`'α'`、`'∞'`" #: src/basic-syntax/scalar-types.md:10 msgid "Booleans" @@ -2953,7 +2940,7 @@ msgstr "`bool`" #: src/basic-syntax/scalar-types.md:10 msgid "`true`, `false`" -msgstr "`true`, `false`" +msgstr "`true`、`false`" #: src/basic-syntax/scalar-types.md:12 msgid "The types have widths as follows:" @@ -2968,12 +2955,10 @@ msgid "`isize` and `usize` are the width of a pointer," msgstr "`isize` 和 `usize` 占用一个指针大小的空间," #: src/basic-syntax/scalar-types.md:16 -#, fuzzy msgid "`char` is 32 bits wide," msgstr "`char` 占用 32 位空间," #: src/basic-syntax/scalar-types.md:17 -#, fuzzy msgid "`bool` is 8 bits wide." msgstr "`bool` 占用 8 位空间。" @@ -3000,8 +2985,8 @@ msgid "" "`1_000` can be written as `1000` (or `10_00`), and `123_i64` can be written " "as `123i64`." msgstr "" -"数字中的所有下划线均可忽略,它们只是为了方便辨识。因此,“1_000”可以写" -"为“1000”(或“10_00”),而“123_i64”可以写为“123i64”。" +"数字中的所有下划线均可忽略,它们只是为了方便辨识。因此,`1_000` 可以写为 " +"`1000`(或 `10_00`),而 `123_i64` 可以写为 `123i64`。" #: src/basic-syntax/compound-types.md:5 msgid "Arrays" @@ -3071,7 +3056,7 @@ msgid "" "Adding `#`, eg `{a:#?}`, invokes a \"pretty printing\" format, which can be " "easier to read." msgstr "" -"添加 `#`, 比如 `{a:#?}`, 会输出“美观打印(pretty printing)” 格式, 这种格式可" +"添加 `#`,比如 `{a:#?}`,会输出“美观打印(pretty printing)” 格式,这种格式可" "能会更加易读。" #: src/basic-syntax/compound-types.md:49 @@ -3100,14 +3085,14 @@ msgid "" "function or expression has no return value, as we'll see in a future slide. " msgstr "" "空元组 `()` 也被称作 “单元(unit)类型”. 它既是一个类型, 也是这种类型的唯一" -"值——也就是说它的类型和它的 值都被表示为 `()`。它通常用于表示,比如,一个 函" -"数或表达式没有返回值,我们会在后续的幻灯片种见到这种用法。" +"值——也就是说它的类型和它的值都被表示为 `()`。它通常用于表示,比如,一个函数或" +"表达式没有返回值,我们会在后续的幻灯片种见到这种用法。" #: src/basic-syntax/compound-types.md:61 msgid "" "You can think of it as `void` that can be familiar to you from other " "programming languages." -msgstr "你可以将其理解为你可能在其他编程语言中比较熟悉的 `void` 类型" +msgstr "你可以将其理解为你可能在其他编程语言中比较熟悉的 `void` 类型。" #: src/basic-syntax/references.md:3 msgid "Like C++, Rust has references:" @@ -3153,7 +3138,7 @@ msgstr "" #: src/basic-syntax/references-dangling.md:3 msgid "Rust will statically forbid dangling references:" -msgstr "Rust 会静态地禁止悬垂引用:" +msgstr "Rust 会静态禁止悬垂引用:" #: src/basic-syntax/references-dangling.md:17 msgid "A reference is said to \"borrow\" the value it refers to." @@ -4015,7 +4000,7 @@ msgstr "在这种情况下,索引迭代在 Rust 中并不是一个特殊的语 #: src/control-flow/for-expressions.md:27 msgid "`(0..10)` is a range that implements an `Iterator` trait. " -msgstr "`(0..10)` 是实现 `Iterator` trait 的范围。" +msgstr "`(0..10)` 是实现 `Iterator` trait 的区间。" #: src/control-flow/for-expressions.md:28 msgid "" @@ -4163,7 +4148,7 @@ msgstr "" #: src/basic-syntax/static-and-const.md:1 msgid "Static and Constant Variables" -msgstr "静态 (Static) 变量和常数 (Constant) 变量" +msgstr "静态变量和常量" #: src/basic-syntax/static-and-const.md:3 msgid "" @@ -4171,8 +4156,8 @@ msgid "" "scoped values that cannot be moved or reallocated during the execution of " "the program. " msgstr "" -"静态变量和常量变量是创建全局范围值的两种不同方法,这类值在程序执行期间无法移" -"动或重新分配。" +"静态变量和常量是创建全局范围值的两种不同方法,这类值在程序执行期间无法移动或" +"重新分配。" #: src/basic-syntax/static-and-const.md:6 msgid "`const`" @@ -4401,13 +4386,13 @@ msgid "" "both variable's memory locations exist at the same time. Both are available " "under the same name, depending where you use it in the code. " msgstr "" -"定义: 隐藏和变更 (mutation) 不同,因为在隐藏之后,两个变量都会同时存在于内存" +"定义: 遮蔽和变更(mutation)不同,因为在遮蔽之后,两个变量都会同时存在于内存" "的不同位置中。在同一个名字下的两个变量都是可以被使用的,但是你在代码的哪里使" "用会最终决定你使用哪一个变量。" #: src/basic-syntax/scopes-shadowing.md:26 msgid "A shadowing variable can have a different type. " -msgstr "一个隐藏变量可以具有不同的类型。" +msgstr "一个遮蔽变量可以具有不同的类型。" #: src/basic-syntax/scopes-shadowing.md:27 msgid "" @@ -4985,7 +4970,7 @@ msgstr "" #: src/pattern-matching.md:6 msgid "The patterns can be simple values, similarly to `switch` in C and C++:" -msgstr "模式 (pattern) 可以是简单的值,其用法类似于 C 与 C++ 中的 `switch` 。" +msgstr "模式(pattern)可以是简单的值,其用法类似于 C 与 C++ 中的 `switch` 。" #: src/pattern-matching.md:8 msgid "" @@ -5235,7 +5220,7 @@ msgstr "向数组中添加更多的值。" msgid "" "Point out that how `..` will expand to account for different number of " "elements." -msgstr "指出 `..` 是如何扩展以适应不同数量的元素的。 " +msgstr "指出 `..` 是如何扩展以适应不同数量的元素的。" #: src/pattern-matching/destructuring-arrays.md:44 msgid "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" @@ -6663,7 +6648,7 @@ msgid "" "trait on some type but don’t have any data that you want to store in the " "value itself. " msgstr "" -"针对某类型实现 trait 时,可能会使用大小为零的结构体“e.g., struct Foo;”,但其" +"针对某类型实现 trait 时,可能会使用大小为零的结构体 `e.g., struct Foo;`,但其" "中没有任何您要储存在值本身中的数据。" #: src/structs.md:39 @@ -6976,7 +6961,7 @@ msgstr "" #: src/methods/receiver.md:14 msgid "`mut self`: same as above, but the method can mutate the object. " -msgstr "“mut self”:同上,但该方法可以改变对象。" +msgstr "`mut self`:同上,但该方法可以改变对象。" #: src/methods/receiver.md:15 msgid "" @@ -7088,8 +7073,8 @@ msgid "" "You might point out that `print_laps` is using a vector that is iterated " "over. We describe vectors in more detail in the afternoon. " msgstr "" -"您或许可以指出“print_laps”使用的是不断迭代的矢量。我们将在下午详细说明这些矢" -"量。" +"您或许可以指出 `print_laps` 使用的是不断迭代的vector。我们将在下午详细说明这" +"些vector。" #: src/exercises/day-2/morning.md:1 msgid "Day 2: Morning Exercises" @@ -8323,7 +8308,7 @@ msgstr "作为相对路径:" #: src/modules/paths.md:6 msgid "`foo` or `self::foo` refers to `foo` in the current module," -msgstr "“foo”或“self::foo”是指当前模块中的“foo”," +msgstr "`foo` 或 `self::foo` 是指当前模块中的 `foo`," #: src/modules/paths.md:7 msgid "`super::foo` refers to `foo` in the parent module." @@ -8335,7 +8320,7 @@ msgstr "作为绝对路径:" #: src/modules/paths.md:10 msgid "`crate::foo` refers to `foo` in the root of the current crate," -msgstr "“crate::foo”是指当前 crate 的根中的“foo”," +msgstr "`crate::foo` 是指当前 crate 的根中的 `foo`," #: src/modules/paths.md:11 msgid "`bar::foo` refers to `foo` in the `bar` crate." @@ -8474,8 +8459,8 @@ msgid "" "`Iterator` trait simply says that you can call `next` until you get `None` " "back:" msgstr "" -"trait 类似于接口:它们描述某类型的行为(方法)。“Iterator”trait 只是告知您可" -"以调用“next”,直到返回“None”:" +"trait 类似于接口:它们描述某类型的行为(方法)。`Iterator` trait 只是告知您可" +"以调用 `next`,直到返回 `None`:" #: src/exercises/day-2/iterators-and-ownership.md:20 msgid "You use this trait like this:" @@ -8538,7 +8523,7 @@ msgstr "这里的语法表示,“IntoIterator”的每个实现都必须声明 #: src/exercises/day-2/iterators-and-ownership.md:65 msgid "`Item`: the type we iterate over, such as `i8`," -msgstr "“Item”:我们迭代的类型,例如“i8”," +msgstr "`Item`:我们迭代的类型,例如 `i8`," #: src/exercises/day-2/iterators-and-ownership.md:66 msgid "`IntoIter`: the `Iterator` type returned by the `into_iter` method." @@ -11486,32 +11471,33 @@ msgstr "您将在以下所有类型之间进行转换:" msgid "" "`&str` to `CString`: you need to allocate space for a trailing `\\0` " "character," -msgstr "将“&str”转换为“CString”:您需要为尾随“\\0”字符分配空格," +msgstr "将 `&str` 转换为 `CString`:您需要为尾随 `\\0` 字符分配空格," #: src/exercises/day-3/safe-ffi-wrapper.md:25 msgid "`CString` to `*const i8`: you need a pointer to call C functions," -msgstr "将“CString”转换为“\\*const i8”:您需要一个指针来调用 C 函数," +msgstr "将 `CString` 转换为 `\\*const i8` :您需要一个指针来调用 C 函数," #: src/exercises/day-3/safe-ffi-wrapper.md:26 msgid "" "`*const i8` to `&CStr`: you need something which can find the trailing `\\0` " "character," -msgstr "将“\\*const i8”转换为“&CStr”:您需要一些能够找到尾随“\\0”字符的内容," +msgstr "" +"将 `\\*const i8` 转换为 `&CStr` :您需要一些能够找到尾随 `\\0` 字符的内容," #: src/exercises/day-3/safe-ffi-wrapper.md:27 msgid "" "`&CStr` to `&[u8]`: a slice of bytes is the universal interface for \"some " "unknow data\"," msgstr "" -"将“&CStr”转换为“&\\[u8\\]”:一个字节 Slice 是“一些未知数据”的通用接口," +"将 `&CStr` 转换为 `&\\[u8\\]` :一个字节 Slice 是“一些未知数据”的通用接口," #: src/exercises/day-3/safe-ffi-wrapper.md:28 msgid "" "`&[u8]` to `&OsStr`: `&OsStr` is a step towards `OsString`, use [`OsStrExt`]" "(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) to create it," msgstr "" -"将“&\\[u8\\]”转换为“&OsStr”:“&OsStr”是向“OsString”迈进的一步,请使用" -"[“OsStrExt”](https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html)来" +"将 `&\\[u8\\]` 转换为 `&OsStr` :`&OsStr` 是向 `OsString` 迈进的一步,请使用" +"[`OsStrExt`](https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html)来" "创建它," #: src/exercises/day-3/safe-ffi-wrapper.md:31 @@ -19019,7 +19005,7 @@ msgstr "另外,请注意,这次您必须使用来自 `tokio` 包的 `Mutex` #: src/exercises/concurrency/dining-philosophers-async.md:77 msgid "Can you make your implementation single-threaded? " -msgstr "您可以使您的实现为单线程吗?" +msgstr "您可以单线程化您的实现吗?" #: src/exercises/concurrency/chat-app.md:3 msgid "" @@ -19140,11 +19126,11 @@ msgid "" "(see the [documentation](https://doc.rust-lang.org/cargo/reference/cargo-" "targets.html#binaries)). " msgstr "" -"通常在一个Cargo项目中,你只能有一个二进制文件,和一个`src/main.rs`文件。在这" -"个项目中,我们需要两个二进制文件。一个用于客户端,另一个用于服务器。你可能会" -"考虑将它们制作成两个单独的Cargo项目,但我们将它们放在一个包含两个二进制文件的" -"Cargo项目中。为了使这个工作,客户端和服务器的代码应该放在`src/bin`下(参见[文" -"档](https://doc.rust-lang.org/cargo/reference/cargo-targets." +"通常在一个 Cargo 项目中,你只能有一个二进制文件,和一个 `src/main.rs` 文件。" +"在这个项目中,我们需要两个二进制文件。一个用于客户端,另一个用于服务器。你可" +"能会考虑将它们制作成两个单独的 Cargo 项目,但我们将它们放在一个包含两个二进制" +"文件的 Cargo 项目中。为了使其工作,客户端和服务器的代码应该放在 `src/bin` 下" +"(参见[文档](https://doc.rust-lang.org/cargo/reference/cargo-targets." "html#binaries))。" #: src/exercises/concurrency/chat-app.md:55 @@ -19481,7 +19467,7 @@ msgstr "" #: src/glossary.md:72 msgid "mutable:" -msgstr "可变" +msgstr "可变:" #: src/glossary.md:73 #, fuzzy