diff --git a/po/zh-CN.po b/po/zh-CN.po index 0bfb62e2..b2ab0af8 100644 --- a/po/zh-CN.po +++ b/po/zh-CN.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: 2024-01-25T10:09:28-08:00\n" +"POT-Creation-Date: 2024-02-08T15:26:53+08:00\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: Language zh-Hans\n" @@ -125,6 +125,14 @@ msgstr "条件控制" msgid "Loops" msgstr "循环控制" +#: src/SUMMARY.md src/control-flow-basics/loops/for.md +msgid "`for`" +msgstr "`for`" + +#: src/SUMMARY.md src/control-flow-basics/loops/loop.md +msgid "`loop`" +msgstr "`loop`" + #: src/SUMMARY.md src/control-flow-basics/break-continue.md msgid "`break` and `continue`" msgstr "`break` 和 `continue`" @@ -1163,7 +1171,6 @@ msgid "Credits" msgstr "鸣谢" #: src/index.md -#, fuzzy msgid "" "[![Build workflow](https://img.shields.io/github/actions/workflow/status/" "google/comprehensive-rust/build.yml?style=flat-square)](https://github.com/" @@ -1179,7 +1186,9 @@ msgstr "" "comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [!" "[GitHub 贡献者](https://img.shields.io/github/contributors/google/" "comprehensive-rust?style=flat-square)](https://github.com/google/" -"comprehensive-rust/graphs/contributors)" +"comprehensive-rust/graphs/contributors) [![GitHub 星标](https://img.shields." +"io/github/stars/google/comprehensive-rust?style=flat-square)](https://github." +"com/google/comprehensive-rust/stargazers)" #: src/index.md msgid "" @@ -1187,8 +1196,8 @@ msgid "" "course covers the full spectrum of Rust, from basic syntax to advanced " "topics like generics and error handling." msgstr "" -"这是由 Android 团队开发的免费 Rust 课程。该课程涵盖了 Rust 的全部范围,从基本" -"语法到高级主题如泛型和错误处理。" +"这是一门由 Android 团队开发的免费 Rust 课程。课程涵盖了 Rust 的全部内容,从基" +"本语法到泛型和错误处理等高级主题。" #: src/index.md msgid "" @@ -1197,13 +1206,13 @@ msgid "" "for updates." msgstr "" "如需查看课程的最新版本,请访问 。如果你是在其他地方阅读,请查看此网址了解是否有更新。" +">。如果您在其他地方阅读,请在那里查看更新。" #: src/index.md msgid "" "The goal of the course is to teach you Rust. We assume you don't know " "anything about Rust and hope to:" -msgstr "本课程的目标是教授你 Rust。我们假设你对 Rust 一无所知,并希望能够:" +msgstr "本课程的目标是教会你使用 Rust。假设你对 Rust 一无所知,本课程可以:" #: src/index.md msgid "Give you a comprehensive understanding of the Rust syntax and language." @@ -1211,21 +1220,20 @@ msgstr "帮助你全面理解 Rust 的语法和语言。" #: src/index.md msgid "Enable you to modify existing programs and write new programs in Rust." -msgstr "使你能够修改现有的程序并用 Rust 编写新程序。" +msgstr "让你可以用 Rust 修改现有程序和编写新程序。" #: src/index.md msgid "Show you common Rust idioms." -msgstr "展示常见的 Rust 习语。" +msgstr "为你展示常见的 Rust 习惯用法。" #: src/index.md -#, fuzzy msgid "We call the first four course days Rust Fundamentals." -msgstr "我们将前三天的课程称为“Rust 基础知识”。" +msgstr "我们将前四天的课程称为“Rust 基础”。" #: src/index.md msgid "" "Building on this, you're invited to dive into one or more specialized topics:" -msgstr "在此基础上,你可以选择深入学习一个或多个专门的主题:" +msgstr "在此基础上,你可以选择深入研究一个或多个专门的主题:" #: src/index.md msgid "" @@ -1236,15 +1244,14 @@ msgstr "" "(AOSP)。课程内容包括与 C、C++ 和 Java 的互操作性。" #: src/index.md -#, fuzzy msgid "" "[Chromium](chromium.md): a half-day course on using Rust within Chromium " "based browsers. This includes interoperability with C++ and how to include " "third-party crates in Chromium." msgstr "" -"[Rust 在 Chromium 中的用法](../chromium.md) 深析是一个为期半天的课程,主要介" -"绍了如何在 Chromium 浏览器中使用 Rust。课程内容包括如何在 Chromium 的 `gn` 构" -"建系统中使用 Rust,引入第三方库 (\"crates\"),以及 C++ 的互操作性。" +"[Chromium](chromium.md):为期半天的课程,介绍如何在基于 Chromium 的浏览器中使" +"用 Rust。课程内容包括与 C++ 的互操作性以及如何在 Chromium 中加入第三方 " +"crate。" #: src/index.md msgid "" @@ -1252,8 +1259,8 @@ msgid "" "(embedded) development. Both microcontrollers and application processors are " "covered." msgstr "" -"[Bare-metal](bare-metal.md):为期一天的课程,介绍如何使用 Rust 进行裸机(嵌入" -"式)开发。课程内容涵盖微控制器和应用处理器。" +"[裸机](bare-metal.md):为期一天的课程,介绍如何使用 Rust 进行裸机(嵌入式)开" +"发。课程内容涵盖微控制器和应用处理器。" #: src/index.md msgid "" @@ -1275,7 +1282,8 @@ msgid "" "Rust is a large language and we won't be able to cover all of it in a few " "days. Some non-goals of this course are:" msgstr "" -"Rust 是一门庞大的语言,我们无法在几天内涵盖所有内容。本课程的一些非目标包括:" +"Rust 是一门庞大的语言,短短几天的课程无法覆盖其全部内容。本课程不包括以下内" +"容:" #: src/index.md msgid "" @@ -1283,13 +1291,13 @@ msgid "" "(https://doc.rust-lang.org/book/ch19-06-macros.html) and [Rust by Example]" "(https://doc.rust-lang.org/rust-by-example/macros.html) instead." msgstr "" -"了解如何开发宏,请参阅 [Rust Book 中的第 19.5 章](https://doc.rust-lang.org/" -"book/ch19-06-macros.html) 和 [Rust by Examples](https://doc.rust-lang.org/" -"rust-by-example/macros.html)。" +"学习如何开发宏:请参阅 [Rust Book 的第 19.5 章](https://doc.rust-lang.org/" +"book/ch19-06-macros.html) 和 [Rust by Examples 对应章节](https://doc.rust-" +"lang.org/rust-by-example/macros.html)。" #: src/index.md msgid "Assumptions" -msgstr "前提假设" +msgstr "学习前提" #: src/index.md msgid "" @@ -1297,16 +1305,16 @@ msgid "" "statically-typed language and we will sometimes make comparisons with C and " "C++ to better explain or contrast the Rust approach." msgstr "" -"本课程假设你已经具备编程知识。Rust 是一种静态类型语言,我们有时会与 C 和 C++ " -"进行比较,以更好地解释或对比 Rust 的方法。" +"本课程假设你已经具备编程知识。Rust 是一种静态类型语言,本课程有时会将其与 C " +"和 C++ 进行比较,以便更好地解释或对比 Rust 的设计。" #: src/index.md msgid "" "If you know how to program in a dynamically-typed language such as Python or " "JavaScript, then you will be able to follow along just fine too." msgstr "" -"如果你已经了解如 Python 或 JavaScript 等动态类型语言的编程,那么你也能够很好" -"地跟上本课程。" +"如果你会使用 Python 或 JavaScript 等动态类型语言编程,那么你也能够很好地跟上" +"进度。" #: src/index.md msgid "" @@ -1314,31 +1322,29 @@ msgid "" "information to the slides. This could be key points which the instructor " "should cover as well as answers to typical questions which come up in class." msgstr "" -"这是演讲者备注的示例。我们将使用这些备注来为幻灯片添加额外的信息。这可能包括" -"讲师应该涵盖的关键点,以及课堂上常见问题的答案。" +"这是演讲者备注(_Speaker Notes_)的示例。页面中使用它来为幻灯片添加备注信息," +"其内容包括讲师应涉及的要点,以及对课堂上可能出现的典型问题的回答。" #: src/running-the-course.md src/running-the-course/course-structure.md msgid "This page is for the course instructor." -msgstr "本页面适用于课程教师。" +msgstr "本页供课程讲师使用。" #: src/running-the-course.md msgid "" "Here is a bit of background information about how we've been running the " "course internally at Google." -msgstr "以下是有关 Google 内部授课方式的一些背景信息。" +msgstr "以下是有关 Google 内部开展课程的一些相关背景。" #: src/running-the-course.md -#, fuzzy msgid "" "We typically run classes from 9:00 am to 4:00 pm, with a 1 hour lunch break " "in the middle. This leaves 3 hours for the morning class and 3 hours for the " "afternoon class. Both sessions contain multiple breaks and time for students " "to work on exercises." msgstr "" -"上课时间通常是从上午 10:00 到下午 4:00,中间有 1 小时的午餐休息时间。这样,上" -"午和下午各留了 2.5 小时的上课时间。请注意,这仅是建议:您也可以上午上课 3 小" -"时,让学员有更多的时间进行练习。上课时间较长的缺点是,学员上了整整 6 小时的" -"课,到了下午可能会非常疲倦。" +"上课时间通常是从上午 9:00 到下午 4:00,中间有 1 小时的午餐休息时间。这样上午" +"和下午就各有 3 小时上课时间。上下午上课时间段内都有多次休息时间和学生做练习的" +"时间。" #: src/running-the-course.md msgid "Before you run the course, you will want to:" @@ -1352,22 +1358,19 @@ msgid "" "notes in a popup (click the link with a little arrow next to \"Speaker " "Notes\"). This way you have a clean screen to present to the class." msgstr "" -"熟悉课程资料。我们添加了演讲者备注,借此强调要点(请帮个忙,多多贡献演讲者备" -"注!)。演示幻灯片时,你应确保在弹出式窗口中打开演讲者备注(点击对应的链接," -"在“演讲者备注”旁边有一个小箭头)。这样,你就可以确保屏幕整洁有序,更好地向全" -"班学员展示课程内容。" +"熟悉课程资料。页面提供了演讲者注释以突出重点(请帮忙多多贡献演讲者备注!)。" +"演讲时,请确保在弹出窗口中打开演讲者笔记(点击“演讲者笔记”旁边带小箭头的链" +"接)。这样就可以确保屏幕整洁有序,更好地向全班学员展示课程内容。" #: src/running-the-course.md -#, fuzzy msgid "" "Decide on the dates. Since the course takes four days, we recommend that you " "schedule the days over two weeks. Course participants have said that they " "find it helpful to have a gap in the course since it helps them process all " "the information we give them." msgstr "" -"确定培训日期。由于本课程至少需要三天的时间,因此我们建议你安排两周以上的时" -"间。课程学员曾表示,在每堂课之间留一段间隔会很有帮助,因为这有利于他们吸收我" -"们所提供的所有信息。" +"决定培训日期。由于课程为期四天,建议将时间安排在两周内。课程学员曾表示,他们" +"认为在课程保留一些间隙有助于更好地进行理解。" #: src/running-the-course.md msgid "" @@ -1379,10 +1382,10 @@ msgid "" "laptops. In particular, you will be doing a lot of live-coding as an " "instructor, so a lectern won't be very helpful for you." msgstr "" -"找一间足以容纳全体线下学员的大教室。我们建议你将课程人数控制在 15-25 人之间。" -"这样,人数足够少,不仅便于学员提问问题,配备的一位教师也有时间答疑解惑。确保" -"教室备有供你和学生使用的“课桌”:你们都需要能够坐下来并操作各自的笔记本电脑。" -"特别是身为教师,你现场要进行大量编码,所以讲台对你来说用处不大。" +"找一间足以容纳全体线下学员的教室。建议的班级人数为 15-25 人。这样少的人数可以" +"让大家能够更轻松地提问,也可以让仅有一位的讲师有足够时间回答问题。确保教室里" +"有讲师和学生用的桌子,并能够坐下来使用笔记本电脑。特别地,讲师需要进行大量的" +"现场编码工作,因此讲台是不需要的。" #: src/running-the-course.md msgid "" @@ -1393,10 +1396,10 @@ msgid "" "as you change pages. Using your laptop will also allow you to fix typos as " "you or the course participants spot them." msgstr "" -"在开课当天,请提前一点到教室,设置好教学设备。我们建议你直接在笔记本电脑上运" -"行 `mdbook serve` 来演示课程内容(请参阅[安装说明](https://github.com/google/" -"comprehensive-rust#building))。这样可以确保你在切换页面时没有延迟,演示效果" -"更好。当你或课程学员发现拼写错误时,你也可以使用笔记本电脑及时更正。" +"课程当天,请提早到教室进行准备。建议直接在笔记本电脑上运行 `mdbook serve` 来" +"演示课程内容(请参阅[安装说明](https://github.com/google/comprehensive-" +"rust#building))。这样可以确保在更换页面时不会出现延迟,演示效果更好。使用笔" +"记本运行还可以在发现错别字时及时更正。" #: src/running-the-course.md msgid "" @@ -1408,16 +1411,16 @@ msgid "" "offer a solution, e.g., by showing people where to find the relevant " "information in the standard library." msgstr "" -"让学员采取小组形式或独立解题。通常,我们会在上午和下午各安排 30-45 分钟的练习" -"时间(包括查看解决方案的时间)。请务必询问学员是否遇到困难,或是否需要任何帮" -"助。如果你看到多位学员遇到同样的问题,请在班级集体进行讲解,并提供相应的解决" -"方案,例如告诉大家在标准库的什么位置可以找到相关信息。" +"让学员自己或以小组为单位解决练习问题。通常在上午和下午各安排 30-45 分钟的练习" +"时间(包括查看解答的时间)。请务必询问学员是否遇到困难,或是否需要任何帮助。" +"如果有多位学员遇到同样的问题,则在班级内进行讲解,并提供相应的解决方案,例如" +"告诉大家在标准库的什么位置可以找到相关信息。" #: src/running-the-course.md msgid "" "That is all, good luck running the course! We hope it will be as much fun " "for you as it has been for us!" -msgstr "今天的分享就是这些,祝你授课顺利!希望你和我们一样,乐在其中!" +msgstr "以上就是全部事项,祝你授课顺利!希望你能像我们一样享受其中的乐趣!" #: src/running-the-course.md msgid "" @@ -1427,171 +1430,165 @@ msgid "" "Your students are also very welcome to [send us feedback](https://github.com/" "google/comprehensive-rust/discussions/100)!" msgstr "" -"欢迎你课后[提供反馈](https://github.com/google/comprehensive-rust/" -"discussions/86),帮助我们不断改进课程。我们非常期待了解哪些方面做得不错,哪些" -"方面还需要改进。同时非常欢迎学生们[向我们发送反馈](https://github.com/google/" -"comprehensive-rust/discussions/100)!" +"欢迎你在课后 [提供反馈](https://github.com/google/comprehensive-rust/" +"discussions/86),以帮助我们不断改进课程。我们非常期待了解哪些方面做得不错,哪" +"些方面还需要改进。同时非常欢迎学生们 [向我们发送反馈](https://github.com/" +"google/comprehensive-rust/discussions/100)!" #: src/running-the-course/course-structure.md msgid "Rust Fundamentals" -msgstr "Rust 基础知识" +msgstr "Rust 基础" #: src/running-the-course/course-structure.md -#, fuzzy msgid "" "The first four days make up [Rust Fundamentals](../welcome-day-1.md). The " "days are fast paced and we cover a lot of ground!" msgstr "" -"我们会在头三天介绍 [Rust 基础知识](../welcome-day-1.md)。这几天的步调会稍快," -"因为我们要探讨许多层面:" +"前四天的内容是 [Rust 基础](../welcome-day-1.md)。这几天的课程节奏很快,内容也" +"很丰富!" #: src/running-the-course/course-structure.md -#, fuzzy msgid "Course schedule:" -msgstr "课程结构" +msgstr "课程安排:" #: src/running-the-course/course-structure.md -msgid "Day 1 Morning (3 hours, including breaks)" -msgstr "" +msgid "Day 1 Morning (2 hours and 40 minutes, including breaks)" +msgstr "第一天上午(2 小时 40 分钟,含休息时间)" #: src/running-the-course/course-structure.md msgid "[Welcome](../welcome-day-1.md) (5 minutes)" -msgstr "" +msgstr "[欢迎](../welcome-day-1.md)(5 分钟)" #: src/running-the-course/course-structure.md msgid "[Hello, World](../hello-world.md) (20 minutes)" -msgstr "" +msgstr "[Hello, World](../hello-world.md)(20 分钟)" #: src/running-the-course/course-structure.md -msgid "[Types and Values](../types-and-values.md) (1 hour and 5 minutes)" -msgstr "" +msgid "[Types and Values](../types-and-values.md) (55 minutes)" +msgstr "[类型和值](../types-and-values.md)(55 分钟)" #: src/running-the-course/course-structure.md -msgid "[Control Flow Basics](../control-flow-basics.md) (1 hour)" -msgstr "" +msgid "[Control Flow Basics](../control-flow-basics.md) (55 minutes)" +msgstr "[控制流](../control-flow-basics.md)(55 分钟)" #: src/running-the-course/course-structure.md msgid "Day 1 Afternoon (2 hours and 55 minutes, including breaks)" -msgstr "" +msgstr "第一天下午(2 小时 55 分钟,含休息时间)" #: src/running-the-course/course-structure.md msgid "[Tuples and Arrays](../tuples-and-arrays.md) (1 hour)" -msgstr "" +msgstr "[元组和数组](../tuples-and-arrays.md)(1 小时)" #: src/running-the-course/course-structure.md msgid "[References](../references.md) (50 minutes)" -msgstr "" +msgstr "[引用](../references.md)(50 分钟)" #: src/running-the-course/course-structure.md msgid "[User-Defined Types](../user-defined-types.md) (50 minutes)" -msgstr "" +msgstr "[用户定义的类型](../user-defined-types.md)(50 分钟)" #: src/running-the-course/course-structure.md -msgid "Day 2 Morning (2 hours and 55 minutes, including breaks)" -msgstr "" +msgid "Day 2 Morning (2 hours and 40 minutes, including breaks)" +msgstr "第二天上午(2 小时 40 分钟,含休息时间)" #: src/running-the-course/course-structure.md msgid "[Welcome](../welcome-day-2.md) (3 minutes)" -msgstr "" +msgstr "[欢迎](../welcome-day-2.md)(3 分钟)" #: src/running-the-course/course-structure.md -#, fuzzy msgid "[Pattern Matching](../pattern-matching.md) (50 minutes)" -msgstr "" -"如需详细了解 Rust 中 的模式,请参阅[模式匹配](../pattern-matching.md)。" +msgstr "[模式匹配](../pattern-matching.md)(50 分钟)" #: src/running-the-course/course-structure.md -msgid "[Methods and Traits](../methods-and-traits.md) (45 minutes)" -msgstr "" +msgid "[Methods and Traits](../methods-and-traits.md) (40 minutes)" +msgstr "[方法和特征](../methods-and-traits.md)(45 分钟)" #: src/running-the-course/course-structure.md -msgid "[Generics](../generics.md) (45 minutes)" -msgstr "" +msgid "[Generics](../generics.md) (40 minutes)" +msgstr "[泛型](../generics.md)(45 分钟)" #: src/running-the-course/course-structure.md -#, fuzzy msgid "Day 2 Afternoon (3 hours, including breaks)" -msgstr "第二天下午的练习" +msgstr "第二天下午(3 小时,含休息时间)" #: src/running-the-course/course-structure.md msgid "[Standard Library Types](../std-types.md) (1 hour and 10 minutes)" -msgstr "" +msgstr "[标准库类型](../std-types.md)(1 小时 10 分钟)" #: src/running-the-course/course-structure.md msgid "[Standard Library Traits](../std-traits.md) (1 hour and 40 minutes)" -msgstr "" +msgstr "[标准库特征](../std-traits.md)(1 小时 40 分钟)" #: src/running-the-course/course-structure.md -msgid "Day 3 Morning (2 hours and 25 minutes, including breaks)" -msgstr "" +msgid "Day 3 Morning (2 hours and 20 minutes, including breaks)" +msgstr "第三天上午(2 小时 20 分钟,含休息时间)" #: src/running-the-course/course-structure.md msgid "[Welcome](../welcome-day-3.md) (3 minutes)" -msgstr "" +msgstr "[欢迎](../welcome-day-3.md)(3 分钟)" #: src/running-the-course/course-structure.md -msgid "[Memory Management](../memory-management.md) (1 hour and 10 minutes)" -msgstr "" +msgid "[Memory Management](../memory-management.md) (1 hour)" +msgstr "[内存管理](../memory-management.md)(1 小时)" #: src/running-the-course/course-structure.md msgid "[Smart Pointers](../smart-pointers.md) (55 minutes)" -msgstr "" +msgstr "[智能指针](../smart-pointers.md)(55 分钟)" #: src/running-the-course/course-structure.md msgid "Day 3 Afternoon (2 hours and 20 minutes, including breaks)" -msgstr "" +msgstr "第三天下午(2 小时 20 分钟,含休息时间)" #: src/running-the-course/course-structure.md msgid "[Borrowing](../borrowing.md) (1 hour)" -msgstr "" +msgstr "[借用](../borrowing.md)(1 小时)" #: src/running-the-course/course-structure.md msgid "" "[Slices and Lifetimes](../slices-and-lifetimes.md) (1 hour and 10 minutes)" -msgstr "" +msgstr "[切片与生命周期](../slices-and-lifetimes.md)(1 小时 10 分钟)" #: src/running-the-course/course-structure.md -msgid "Day 4 Morning (3 hours and 5 minutes, including breaks)" -msgstr "" +msgid "Day 4 Morning (2 hours and 50 minutes, including breaks)" +msgstr "第四天上午(2 小时 50 分钟,含休息时间)" #: src/running-the-course/course-structure.md msgid "[Welcome](../welcome-day-4.md) (3 minutes)" -msgstr "" +msgstr "[欢迎](../welcome-day-4.md)(3 分钟)" #: src/running-the-course/course-structure.md msgid "[Iterators](../iterators.md) (45 minutes)" -msgstr "" +msgstr "[迭代器](../iterators.md)(45 分钟)" #: src/running-the-course/course-structure.md msgid "[Modules](../modules.md) (40 minutes)" -msgstr "" +msgstr "[模块](../modules.md)(40 分钟)" #: src/running-the-course/course-structure.md -msgid "[Testing](../testing.md) (1 hour and 5 minutes)" -msgstr "" +msgid "[Testing](../testing.md) (1 hour)" +msgstr "[测试](../testing.md)(1 小时)" #: src/running-the-course/course-structure.md msgid "Day 4 Afternoon (2 hours, including breaks)" -msgstr "" +msgstr "第四天下午(2 小时,含休息时间)" #: src/running-the-course/course-structure.md msgid "[Error Handling](../error-handling.md) (45 minutes)" -msgstr "" +msgstr "[错误处理](../error-handling.md)(45 分钟)" #: src/running-the-course/course-structure.md msgid "[Unsafe Rust](../unsafe-rust.md) (1 hour and 5 minutes)" -msgstr "" +msgstr "[不安全 Rust](../unsafe-rust.md)(1 小时 5 分钟)" #: src/running-the-course/course-structure.md msgid "Deep Dives" msgstr "深入探究" #: src/running-the-course/course-structure.md -#, fuzzy msgid "" "In addition to the 4-day class on Rust Fundamentals, we cover some more " "specialized topics:" -msgstr "除了为期 3 天的“Rust 基础知识”课程外,我们还推出了一些专题课程:" +msgstr "除了为期四天的“Rust 基础”课程外,还有一些专业课题提供:" #: src/running-the-course/course-structure.md msgid "Rust in Android" @@ -1603,8 +1600,8 @@ msgid "" "Rust for Android platform development. This includes interoperability with " "C, C++, and Java." msgstr "" -"[深入探究 Android](../android.md)课程为期半天,旨在介绍如何使用 Rust 进行 " -"Android 平台开发。其中包括与 C、C++ 和 Java 的互操作性。" +"深入探究 [Android 中的 Rust](../android.md) 课程为期半天,旨在介绍如何使用 " +"Rust 进行 Android 平台开发。其中包括与 C、C++ 和 Java 的互操作性。" #: src/running-the-course/course-structure.md msgid "" @@ -1614,9 +1611,9 @@ msgid "" "android/` directory into the root of your AOSP checkout. This will ensure " "that the Android build system sees the `Android.bp` files in `src/android/`." msgstr "" -"你将需要[签出 AOSP](https://source.android.com/docs/setup/download/" -"downloading)。在同一机器上签出[课程库](https://github.com/google/" -"comprehensive-rust), 然后将 `src/android/` 目录移至所签出的 AOSP 的根目录。" +"你需要 [检出 AOSP](https://source.android.com/docs/setup/download/" +"downloading)。在同一机器上检出 [课程库](https://github.com/google/" +"comprehensive-rust), 然后将 `src/android/` 目录移至所检出的 AOSP 的根目录。" "这将确保 Android 构建系统能检测到 `src/android/` 中的 `Android.bp` 文件。" #: src/running-the-course/course-structure.md @@ -1630,21 +1627,19 @@ msgstr "" "能在你手动运行时正确执行。" #: src/running-the-course/course-structure.md -#, fuzzy msgid "Rust in Chromium" -msgstr "在 Chromium 中使用 CXX" +msgstr "Chromium 中的 Rust" #: src/running-the-course/course-structure.md -#, fuzzy msgid "" "The [Rust in Chromium](../chromium.md) deep dive is a half-day course on " "using Rust as part of the Chromium browser. It includes using Rust in " "Chromium's `gn` build system, bringing in third-party libraries (\"crates\") " "and C++ interoperability." msgstr "" -"[Rust 在 Chromium 中的用法](../chromium.md) 深析是一个为期半天的课程,主要介" -"绍了如何在 Chromium 浏览器中使用 Rust。课程内容包括如何在 Chromium 的 `gn` 构" -"建系统中使用 Rust,引入第三方库 (\"crates\"),以及 C++ 的互操作性。" +"深入探究 [Chromium 中的 Rust](../chromium.md) 课程为期半天,旨在介绍 " +"Chromium 浏览器中 Rust 的使用。课程内容包括在 Chromium 的 `gn` 编译系统中使" +"用 Rust,引入第三方 crate,以及与 C++ 的互操作性。" #: src/running-the-course/course-structure.md msgid "" @@ -1652,13 +1647,13 @@ msgid "" "[recommended](../chromium/setup.md) for speed but any build will work. " "Ensure that you can run the Chromium browser that you've built." msgstr "" -"您需要具备构建 Chromium 的能力。为了提高速度,[建议使用] 调试组件 build (../" -"chromium/setup.md),但任何类型的 build 均可使用。请确保可以运行您所构建的 " -"Chromium 浏览器。" +"您需要能够构建 Chromium。为了提高速度,建议使用调试、组件 [构建方式](../" +"chromium/setup.md),其他构建方式也可以使用。确保所构建的 Chromium 浏览器可以" +"正常运行。" #: src/running-the-course/course-structure.md msgid "Bare-Metal Rust" -msgstr "裸金属 Rust" +msgstr "裸机 Rust" #: src/running-the-course/course-structure.md msgid "" @@ -1666,8 +1661,8 @@ msgid "" "using Rust for bare-metal (embedded) development. Both microcontrollers and " "application processors are covered." msgstr "" -"[深入探究裸金属 Rust](../bare-metal.md)课程为期一天,旨在介绍如何使用 Rust 进" -"行裸金属(嵌入式)开发。其中涵盖了微控制器和应用处理器。" +"深入探究 [裸机 Rust](../bare-metal.md) 课程为期一天,旨在介绍如何使用 Rust 进" +"行裸机(嵌入式)开发。其中涵盖了微控制器和应用处理器。" #: src/running-the-course/course-structure.md msgid "" @@ -1676,9 +1671,8 @@ msgid "" "need to install a number of packages as described on the [welcome page](../" "bare-metal.md)." msgstr "" -"对于微控制器部分,你需要提前购买 [BBC micro:bit](https://microbit.org/) 第 2 " -"版开发板。每个人都需要安装多个软件包, 具体如[欢迎页面](../bare-metal.md)中所" -"述。" +"对于微控制器部分,需要提前购买 [BBC micro:bit](https://microbit.org/) v2 开发" +"板。每个人都需要安装多个软件包, 具体如 [欢迎页面](../bare-metal.md) 中所述。" #: src/running-the-course/course-structure.md msgid "Concurrency in Rust" @@ -1689,8 +1683,8 @@ 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`/" -"`await` 并发。" +"深入探究 [Rust 中的并发](../concurrency.md) 课程为期一天,旨在介绍传统并发和 " +"`async`/`await` 并发。" #: src/running-the-course/course-structure.md msgid "" @@ -1766,7 +1760,6 @@ msgstr "" "[@henrif75](https://github.com/henrif75)。" #: src/running-the-course/translations.md -#, fuzzy msgid "" "[Chinese (Simplified)](https://google.github.io/comprehensive-rust/zh-CN/) " "by [@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/" @@ -1776,13 +1769,13 @@ msgid "" "(https://github.com/nodmp)." msgstr "" "[简体中文版本](https://google.github.io/comprehensive-rust/zh-CN/) 译者:" -"[@suetfei](https://github.com/suetfei)、[@wnghl](https://github.com/wnghl), " -"[@anlunx](https://github.com/anlunx)、[@kongy](https://github.com/kongy), " -"[@noahdragon](https://github.com/noahdragon) 和 [@superwhd](https://github." -"com/superwhd)。" +"[@suetfei](https://github.com/suetfei)、[@wnghl](https://github.com/wnghl)、" +"[@anlunx](https://github.com/anlunx)、[@kongy](https://github.com/kongy)、" +"[@noahdragon](https://github.com/noahdragon)、[@superwhd](https://github.com/" +"superwhd)、[@SketchK](https://github.com/SketchK) 和 [@nodmp](https://github." +"com/nodmp)。" #: src/running-the-course/translations.md -#, fuzzy msgid "" "[Chinese (Traditional)](https://google.github.io/comprehensive-rust/zh-TW/) " "by [@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" @@ -1792,8 +1785,9 @@ msgid "" msgstr "" "[繁体中文版本](https://google.github.io/comprehensive-rust/zh-TW/) 译者:" "[@hueich](https://github.com/hueich)、[@victorhsieh](https://github.com/" -"victorhsieh)、[@mingyc](https://github.com/mingyc) 和 [@johnathan79717]" -"(https://github.com/johnathan79717)。" +"victorhsieh)、[@mingyc](https://github.com/mingyc)、[@kuanhungchen](https://" +"github.com/kuanhungchen) 和 [@johnathan79717](https://github.com/" +"johnathan79717)。" #: src/running-the-course/translations.md msgid "" @@ -1826,7 +1820,7 @@ msgstr "未完成的翻译" msgid "" "There is a large number of in-progress translations. We link to the most " "recently updated translations:" -msgstr "多数语言版本仍在翻译中。我们会提供最近更新的翻译的链接:" +msgstr "还有很多语言版本仍在翻译中。以下是最近更新的翻译版本的链接:" #: src/running-the-course/translations.md msgid "" @@ -1863,14 +1857,14 @@ msgstr "" "momotaro1105)。" #: src/running-the-course/translations.md -#, fuzzy msgid "" "[Italian](https://google.github.io/comprehensive-rust/it/) by " "[@henrythebuilder](https://github.com/henrythebuilder) and [@detro](https://" "github.com/detro)." msgstr "" -"[德语版本](https://google.github.io/comprehensive-rust/de/) 译者:[@Throvn]" -"(https://github.com/Throvn) 和 [@ronaldfw](https://github.com/ronaldfw)。" +"[意大利语版本](https://google.github.io/comprehensive-rust/it/) 译者:" +"[@henrythebuilder](https://github.com/henrythebuilder) 和 [@detro](https://" +"github.com/detro)。" #: src/running-the-course/translations.md msgid "" @@ -1879,9 +1873,9 @@ msgid "" "get going. Translations are coordinated on the [issue tracker](https://" "github.com/google/comprehensive-rust/issues/282)." msgstr "" -"如果你想帮助我们,请参阅[我们的说明](https://github.com/google/comprehensive-" -"rust/blob/main/TRANSLATIONS.md),了解如何开始翻译。翻译工作将通过[问题跟踪器]" -"(https://github.com/google/comprehensive-rust/issues/282)跟踪。" +"如果你想协助翻译,请参阅 [翻译说明](https://github.com/google/comprehensive-" +"rust/blob/main/TRANSLATIONS.md),了解如何开始翻译工作。翻译工作可通过 [此议" +"题](https://github.com/google/comprehensive-rust/issues/282) 追踪。" #: src/cargo.md msgid "" @@ -1923,12 +1917,12 @@ 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]" -"(https://code.visualstudio.com/)、[Emacs](https://rust-analyzer.github.io/" -"manual.html#emacs)、[Vim/Neovim](https://rust-analyzer.github.io/manual." -"html#vimneovim)及其他许多编辑器提供了自动补全及定义跳转的功能。同样也可以用一" -"个叫[RustRover](https://www.jetbrains.com/rust/)的IDE。" +"安装 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) 及其他许多编辑器提供了自动补全及定义跳转的功能。同样也可以使" +"用 [RustRover](https://www.jetbrains.com/rust/) IDE。" #: src/cargo.md msgid "" @@ -1948,7 +1942,7 @@ msgstr "Rust 生态系统" #: src/cargo/rust-ecosystem.md msgid "" "The Rust ecosystem consists of a number of tools, of which the main ones are:" -msgstr "Rust 生态系统由许多工具组成,其中的主要工具包括:" +msgstr "Rust 生态系统由许多工具组成,主要包括:" #: src/cargo/rust-ecosystem.md msgid "" @@ -1968,7 +1962,6 @@ msgstr "" "置的测试运行程序,用于执行单元测试。" #: src/cargo/rust-ecosystem.md -#, fuzzy msgid "" "`rustup`: the Rust toolchain installer and updater. This tool is used to " "install and update `rustc` and `cargo` when new versions of Rust are " @@ -1976,9 +1969,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 src/hello-world/hello-world.md #: src/tuples-and-arrays/tuples-and-arrays.md src/references/exclusive.md @@ -1994,35 +1987,36 @@ msgid "" "weeks. New releases maintain backwards compatibility with old releases --- " "plus they enable new functionality." msgstr "" -"Rust 有一个快速发布时间表,每六周就会发布一次 新版本。新版本保持与旧版本的向" -"后兼容性,还添加了新功能。" +"Rust 有一个快速发布时间表,每六周就会发布一次新版本。新版本保持与旧版本的向后" +"兼容性,并添加新功能。" #: src/cargo/rust-ecosystem.md msgid "" "There are three release channels: \"stable\", \"beta\", and \"nightly\"." -msgstr "共有三个发布阶段:“稳定版”、“Beta 版”和“夜间版”。" +msgstr "" +"共有三个发布阶段:“稳定版(stable)”、“测试版(beta)”和“夜间版(nightly)”。" #: src/cargo/rust-ecosystem.md msgid "" "New features are being tested on \"nightly\", \"beta\" is what becomes " "\"stable\" every six weeks." -msgstr "我们会在“夜间版”上测试新功能,每六周将“Beta 版”升级为“稳定版”。" +msgstr "新功能会先在“夜间版”上测试,“测试版”会每六周转为“稳定版”。" #: src/cargo/rust-ecosystem.md msgid "" "Dependencies can also be resolved from alternative [registries](https://doc." "rust-lang.org/cargo/reference/registries.html), git, folders, and more." msgstr "" -"您也可以通过备用的[注册数据库](https://doc.rust-lang.org/cargo/reference/" -"registries.html)、git及文件夹等资源来解析依赖项。" +"依赖关系也可以通过其他 [registry](https://doc.rust-lang.org/cargo/reference/" +"registries.html)、git 及文件夹等解析。" #: src/cargo/rust-ecosystem.md 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 2018。" +"Rust 区分 [版本(edition)](https://doc.rust-lang.org/edition-guide/):当前版" +"本是 Rust 2021。之前的版本是 Rust 2015 和 Rust 2018。" #: src/cargo/rust-ecosystem.md msgid "" @@ -2035,8 +2029,8 @@ msgid "" "To prevent breaking code, editions are opt-in: you select the edition for " "your crate via the `Cargo.toml` file." msgstr "" -"为防止破坏代码,你可以自行选择版本: 通过 `Cargo.toml` 文件为 crate 选择合适" -"的版本。" +"为防止破坏代码,版本是可选的: 通过 `Cargo.toml` 文件为 crate 选择合适的版" +"本。" #: src/cargo/rust-ecosystem.md msgid "" @@ -2049,16 +2043,15 @@ msgid "" "Mention that it is quite rare to ever use the compiler directly not through " "`cargo` (most users never do)." msgstr "" -"提及不通过 `cargo` 而直接使用编译器的情况相当少见(大多数用户从不这样做)。" +"请注意,不借助 `cargo` 直接使用编译器的情况相当少见(大多数用户从不这样做)。" #: src/cargo/rust-ecosystem.md -#, fuzzy msgid "" "It might be worth alluding that Cargo itself is an extremely powerful and " "comprehensive tool. It is capable of many advanced features including but " "not limited to:" msgstr "" -"值得注意的是,Cargo 本身就是一个功能强大且全面的工具。它能够实现许多高级功" +"值得一提的是,Cargo 本身就是一个功能强大且全面的工具。它能够实现许多高级功" "能,包括但不限于:" #: src/cargo/rust-ecosystem.md @@ -2067,23 +2060,25 @@ msgstr "项目/软件包结构" #: src/cargo/rust-ecosystem.md msgid "[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" -msgstr "\\[工作区\\]" +msgstr "[工作区](https://doc.rust-lang.org/cargo/reference/workspaces.html)" #: src/cargo/rust-ecosystem.md msgid "Dev Dependencies and Runtime Dependency management/caching" -msgstr "开发依赖项和运行时依赖项管理/缓存" +msgstr "开发依赖和运行时依赖管理/缓存" #: src/cargo/rust-ecosystem.md msgid "" "[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts." "html)" -msgstr "\\[构建脚本\\]" +msgstr "" +"[构建脚本](https://doc.rust-lang.org/cargo/reference/build-scripts.html)" #: src/cargo/rust-ecosystem.md msgid "" "[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install." "html)" -msgstr "\\[全局安装\\] \\]" +msgstr "" +"[全局安装](https://doc.rust-lang.org/cargo/commands/cargo-install.html)" #: src/cargo/rust-ecosystem.md msgid "" @@ -2096,7 +2091,7 @@ msgstr "" #: src/cargo/rust-ecosystem.md msgid "" "Read more from the [official Cargo Book](https://doc.rust-lang.org/cargo/)" -msgstr "如需了解详情,请参阅\\[ Cargo 官方图书\\]" +msgstr "详情请参阅 [官方 Cargo Book](https://doc.rust-lang.org/cargo/)" #: src/cargo/code-samples.md msgid "Code Samples in This Training" @@ -2108,8 +2103,8 @@ 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 msgid "" @@ -2118,7 +2113,7 @@ msgid "" "how to work with dependencies and for that you need Cargo." msgstr "" "我们仍然建议你安装 Cargo:它有助于你更轻松地完成练习。在最后一天,我们要做一" -"个更大的练习, 向你展示如何使用依赖项,因此你需要安装 Cargo。" +"个综合的练习, 向你展示如何使用依赖项,因此你需要安装 Cargo。" #: src/cargo/code-samples.md msgid "The code blocks in this course are fully interactive:" @@ -2130,27 +2125,25 @@ msgstr "\"Edit me!\"" #: src/cargo/code-samples.md msgid "You can use " -msgstr "当文本框为焦点时,你可以使用" +msgstr "你可以使用 " #: src/cargo/code-samples.md -#, fuzzy msgid " to execute the code when focus is in the text box." -msgstr "来执行代码。" +msgstr " 来执行焦点所在文本框的代码。" #: src/cargo/code-samples.md 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 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 @@ -2159,8 +2152,8 @@ 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 会在你离开页面后立即丢失其状态!正因如此,学员应使用本地安" -"装的 Rust 或通过 Playground 解题。" +"嵌入的 Playground 会在离开页面后丢失编辑状态!因此,学员应使用本地安装的 " +"Rust 或通过 Playground 解题。" #: src/cargo/running-locally.md msgid "Running Code Locally with Cargo" @@ -2174,49 +2167,49 @@ msgid "" "should give you a working `rustc` and `cargo`. At the time of writing, the " "latest stable Rust release has these version numbers:" msgstr "" -"如果你想在自己的系统上对代码进行实验, 则需要先安装 Rust。为此,请按照 [Rust " -"图书中的说明](https://doc.rust-lang.org/book/ch01-01-installation.html)操作。" -"这应会为你提供一个有效的 `rustc` 和 `cargo`。在撰写本文时,最新的 Rust 稳定版" -"具有以下版本号:" +"如果你想在自己的系统上进行代码实验, 则需要先安装 Rust。为此,请按照 [Rust " +"Book 中的说明](https://doc.rust-lang.org/book/ch01-01-installation.html) 操" +"作。这应会为你提供一个有效的 `rustc` 和 `cargo`。在撰写本文时,最新的 Rust 稳" +"定版是以下的版本号:" #: src/cargo/running-locally.md msgid "" "You can use any later version too since Rust maintains backwards " "compatibility." -msgstr "您也可以使用任何更高版本,因为 Rust 保持向后兼容性。" +msgstr "你也可以使用任何更高版本,因为 Rust 保持向后兼容性。" #: src/cargo/running-locally.md msgid "" "With this in place, follow these steps to build a Rust binary from one of " "the examples in this training:" msgstr "" -"了解这些信息后,请按照以下步骤从本培训中的 一个示例中构建 Rust 二进制文件:" +"了解这些信息后,请按照以下步骤从本培训中的一个示例中构建 Rust 二进制文件:" #: src/cargo/running-locally.md msgid "Click the \"Copy to clipboard\" button on the example you want to copy." -msgstr "在你要复制的示例上点击“复制到剪贴板”按钮。" +msgstr "在你要复制的示例上点击“复制到剪贴板(Copy to clipboard)”按钮。" #: src/cargo/running-locally.md msgid "" "Use `cargo new exercise` to create a new `exercise/` directory for your code:" -msgstr "使用 `cargo new exercise` 为你的代码新建一个 `exercise/` 目录:" +msgstr "使用 `cargo new exercise` 为代码新建一个 `exercise/` 目录:" #: src/cargo/running-locally.md msgid "" "Navigate into `exercise/` and use `cargo run` to build and run your binary:" -msgstr "导航至 `exercise/` 并使用 `cargo run` 构建并运行你的二进制文件:" +msgstr "转到 `exercise/` 并使用 `cargo run` 构建并运行二进制文件:" #: src/cargo/running-locally.md msgid "" "Replace the boiler-plate code in `src/main.rs` with your own code. For " "example, using the example on the previous page, make `src/main.rs` look like" msgstr "" -"将 `src/main.rs` 中的样板代码替换为你自己的代码。例如, 使用上一页中的示例," -"将 `src/main.rs` 改为:" +"将 `src/main.rs` 中的样板代码替换为自己的代码。例如, 使用上一页中的示例,将 " +"`src/main.rs` 改为:" #: src/cargo/running-locally.md msgid "Use `cargo run` to build and run your updated binary:" -msgstr "使用 `cargo run` 构建并运行你更新后的二进制文件:" +msgstr "使用 `cargo run` 构建并运行更新后的二进制文件:" #: src/cargo/running-locally.md msgid "" @@ -2235,8 +2228,8 @@ msgid "" "run `cargo` commands, it will automatically download and compile missing " "dependencies for you." msgstr "" -"你可以通过修改 `Cargo.toml` 为项目添加依赖项。当你 运行 `cargo` 命令时,系统" -"会自动为你下载和编译缺失 的依赖项。" +"可以通过修改 `Cargo.toml` 为项目添加依赖项。当运行 `cargo` 命令时,系统会自动" +"下载和编译缺失的依赖项。" #: src/cargo/running-locally.md msgid "" @@ -2244,7 +2237,7 @@ msgid "" "editor. It will make their life easier since they will have a normal " "development environment." msgstr "" -"尽量鼓励全班学员安装 Cargo 并使用 本地编辑器。这能为他们营造常规 开发环境,让" +"尽量鼓励全班学员安装 Cargo 并使用本地编辑器。这能使他们拥有常规的开发环境,让" "工作变得更加轻松。" #: src/welcome-day-1.md @@ -2303,15 +2296,17 @@ msgid "[Hello, World](./hello-world.md) (20 minutes)" msgstr "" #: src/welcome-day-1.md -msgid "[Types and Values](./types-and-values.md) (1 hour and 5 minutes)" +msgid "[Types and Values](./types-and-values.md) (55 minutes)" msgstr "" #: src/welcome-day-1.md -msgid "[Control Flow Basics](./control-flow-basics.md) (1 hour)" +msgid "[Control Flow Basics](./control-flow-basics.md) (55 minutes)" msgstr "" -#: src/welcome-day-1.md src/welcome-day-2-afternoon.md -msgid "Including 10 minute breaks, this session should take about 3 hours" +#: src/welcome-day-1.md src/welcome-day-2.md +msgid "" +"Including 10 minute breaks, this session should take about 2 hours and 40 " +"minutes" msgstr "" #: src/welcome-day-1.md @@ -2752,27 +2747,29 @@ msgid "[Variables](./types-and-values/variables.md) (5 minutes)" msgstr "" #: src/types-and-values.md -msgid "[Values](./types-and-values/values.md) (10 minutes)" +msgid "[Values](./types-and-values/values.md) (5 minutes)" msgstr "" #: src/types-and-values.md -msgid "[Arithmetic](./types-and-values/arithmetic.md) (5 minutes)" +msgid "[Arithmetic](./types-and-values/arithmetic.md) (3 minutes)" msgstr "" #: src/types-and-values.md -msgid "[Strings](./types-and-values/strings.md) (10 minutes)" +#, fuzzy +msgid "[Strings](./types-and-values/strings.md) (5 minutes)" msgstr "" +"如需详细了解 Rust 中 的模式,请参阅 [模式匹配](../pattern-matching.md)。" #: src/types-and-values.md -msgid "[Type Inference](./types-and-values/inference.md) (5 minutes)" +msgid "[Type Inference](./types-and-values/inference.md) (3 minutes)" msgstr "" #: src/types-and-values.md msgid "[Exercise: Fibonacci](./types-and-values/exercise.md) (30 minutes)" msgstr "" -#: src/types-and-values.md src/testing.md src/unsafe-rust.md -msgid "This segment should take about 1 hour and 5 minutes" +#: src/types-and-values.md src/control-flow-basics.md src/smart-pointers.md +msgid "This segment should take about 55 minutes" msgstr "" #: src/types-and-values/variables.md @@ -2782,19 +2779,20 @@ msgid "" "`let`:" msgstr "Rust 通过静态类型实现了类型安全。变量绑定默认是不可变的:" -#: src/types-and-values/variables.md src/control-flow-basics/loops.md +#: src/types-and-values/variables.md src/control-flow-basics/loops/for.md #: src/control-flow-basics/break-continue.md #: src/control-flow-basics/blocks-and-scopes.md msgid "\"x: {x}\"" msgstr "\"x: {x}\"" #: src/types-and-values/variables.md -msgid "" -"// x = 20;\n" -" // println!(\"x: {x}\");\n" +msgid "// x = 20;" msgstr "" -"// x = 20;\n" -" // println!(\"x: {x}\");\n" + +#: src/types-and-values/variables.md +#, fuzzy +msgid "// println!(\"x: {x}\");" +msgstr "// println!(\"s1: {s1}\");\n" #: src/types-and-values/variables.md msgid "" @@ -3007,7 +3005,8 @@ msgid "\"{:?}\"" msgstr "\"{:?}\"" #: src/types-and-values/strings.md -msgid "//println!(\"{:?}\", &sentence[12..13]);\n" +#, fuzzy +msgid "//println!(\"{:?}\", &sentence[12..13]);" msgstr "//println!(\"{:?}\", &sentence[12..13]);\n" #: src/types-and-values/strings.md @@ -3057,6 +3056,12 @@ msgstr "" "原始字符串可在创建 `&str` 时禁用转义:`r\"\\n\" == \"\\\\n\"`。可以在外层引号" "两侧添加相同数量的 `#`,以在字符串中嵌入双引号:" +#: src/types-and-values/strings.md +msgid "" +"Using `{:?}` is a convenient way to print array/vector/struct of values for " +"debugging purposes, and it's commonly used in code." +msgstr "" + #: src/types-and-values/inference.md msgid "Rust will look at how the variable is _used_ to determine the type:" msgstr "Rust 会根据变量的使用来确定其类型:" @@ -3089,7 +3094,8 @@ msgstr "" "`{integer}`。同样,浮点字面量默认为 `f64`。" #: src/types-and-values/inference.md -msgid "// ERROR: no implementation for `{float} == {integer}`\n" +#, fuzzy +msgid "// ERROR: no implementation for `{float} == {integer}`" msgstr "// ERROR: no implementation for `{float} == {integer}`\n" #: src/types-and-values/exercise.md @@ -3110,7 +3116,8 @@ msgid "" msgstr "编写一个函数 `fib(n)`,用于计算第 n 个斐波那契数。何时该函数会 panic?" #: src/types-and-values/exercise.md -msgid "// The base case.\n" +#, fuzzy +msgid "// The base case." msgstr "// The base case.\n" #: src/types-and-values/exercise.md src/control-flow-basics/exercise.md @@ -3119,7 +3126,8 @@ msgid "\"Implement this\"" msgstr "实现" #: src/types-and-values/exercise.md -msgid "// The recursive case.\n" +#, fuzzy +msgid "// The recursive case." msgstr "// The recursive case.\n" #: src/types-and-values/exercise.md src/types-and-values/solution.md @@ -3127,7 +3135,7 @@ msgid "\"fib(n) = {}\"" msgstr "\"fib(n) = {}\"" #: src/control-flow-basics.md -msgid "[Conditionals](./control-flow-basics/conditionals.md) (5 minutes)" +msgid "[Conditionals](./control-flow-basics/conditionals.md) (4 minutes)" msgstr "" #: src/control-flow-basics.md @@ -3136,12 +3144,12 @@ msgstr "" #: src/control-flow-basics.md msgid "" -"[break and continue](./control-flow-basics/break-continue.md) (5 minutes)" +"[break and continue](./control-flow-basics/break-continue.md) (4 minutes)" msgstr "" #: src/control-flow-basics.md msgid "" -"[Blocks and Scopes](./control-flow-basics/blocks-and-scopes.md) (10 minutes)" +"[Blocks and Scopes](./control-flow-basics/blocks-and-scopes.md) (5 minutes)" msgstr "" #: src/control-flow-basics.md @@ -3157,10 +3165,6 @@ msgid "" "[Exercise: Collatz Sequence](./control-flow-basics/exercise.md) (30 minutes)" msgstr "" -#: src/control-flow-basics.md src/tuples-and-arrays.md src/borrowing.md -msgid "This segment should take about 1 hour" -msgstr "" - #: src/control-flow-basics/conditionals.md msgid "Much of the Rust syntax will be familiar to you from C, C++ or Java:" msgstr "Rust 的许多语法与 C、C++ 和 Java 的语法相似:" @@ -3266,12 +3270,7 @@ msgstr "" msgid "\"Final x: {x}\"" msgstr "\"Final x: {x}\"" -#: src/control-flow-basics/loops.md -#, fuzzy -msgid "`for`" -msgstr "`for` 循环" - -#: src/control-flow-basics/loops.md +#: src/control-flow-basics/loops/for.md #, fuzzy msgid "" "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) iterates " @@ -3280,11 +3279,20 @@ msgstr "" "[`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) 用于定义析构函" "数。" -#: src/control-flow-basics/loops.md -msgid "`loop`" -msgstr "`loop`" +#: src/control-flow-basics/loops/for.md +msgid "" +"We will discuss iteration later; for now, just stick to range expressions." +msgstr "我们稍后会讨论迭代;暂时只使用范围表达式。" -#: src/control-flow-basics/loops.md +#: src/control-flow-basics/loops/for.md +msgid "" +"Note that the `for` loop only iterates to `4`. Show the `1..=5` syntax for " +"an inclusive range." +msgstr "" +"请注意,`for` 循环只迭代到 `4`。现在展示使用 `1..=5` 语法表示一个包含边界的范" +"围。" + +#: src/control-flow-basics/loops/loop.md #, fuzzy msgid "" "The [`loop` statement](https://doc.rust-lang.org/std/keyword.loop.html) just " @@ -3293,23 +3301,10 @@ msgstr "" "[`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) 用于定义析构函" "数。" -#: src/control-flow-basics/loops.md +#: src/control-flow-basics/loops/loop.md msgid "\"{i}\"" msgstr "\"{i}\"" -#: src/control-flow-basics/loops.md -msgid "" -"We will discuss iteration later; for now, just stick to range expressions." -msgstr "我们稍后会讨论迭代;暂时只使用范围表达式。" - -#: src/control-flow-basics/loops.md -msgid "" -"Note that the `for` loop only iterates to `4`. Show the `1..=5` syntax for " -"an inclusive range." -msgstr "" -"请注意,`for` 循环只迭代到 `4`。现在展示使用 `1..=5` 语法表示一个包含边界的范" -"围。" - #: src/control-flow-basics/break-continue.md #, fuzzy msgid "" @@ -3759,7 +3754,7 @@ msgstr "" msgid "[User-Defined Types](./user-defined-types.md) (50 minutes)" msgstr "" -#: src/welcome-day-1-afternoon.md src/welcome-day-2.md +#: src/welcome-day-1-afternoon.md msgid "" "Including 10 minute breaks, this session should take about 2 hours and 55 " "minutes" @@ -3786,6 +3781,11 @@ msgstr "" msgid "[Exercise: Nested Arrays](./tuples-and-arrays/exercise.md) (30 minutes)" msgstr "" +#: src/tuples-and-arrays.md src/memory-management.md src/borrowing.md +#: src/testing.md +msgid "This segment should take about 1 hour" +msgstr "" + #: src/tuples-and-arrays/tuples-and-arrays.md msgid "" "Tuples and arrays are the first \"compound\" types we have seen. All " @@ -4197,7 +4197,8 @@ msgstr "将下面的代码复制到 并实现上 #: src/tuples-and-arrays/exercise.md src/borrowing/exercise.md #: src/unsafe-rust/exercise.md -msgid "// TODO: remove this when you're done with your implementation.\n" +#, fuzzy +msgid "// TODO: remove this when you're done with your implementation." msgstr "// TODO: remove this when you're done with your implementation.\n" #: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md @@ -4365,29 +4366,37 @@ msgstr "" "确定。" #: src/references/exercise.md +#, fuzzy msgid "" "// Calculate the magnitude of a vector by summing the squares of its " -"coordinates\n" -"// and taking the square root. Use the `sqrt()` method to calculate the " -"square\n" -"// root, like `v.sqrt()`.\n" -msgstr "" -"// Calculate the magnitude of a vector by summing the squares of its " -"coordinates\n" -"// and taking the square root. Use the `sqrt()` method to calculate the " -"square\n" -"// root, like `v.sqrt()`.\n" +"coordinates" +msgstr "/// Calculate the magnitude of the given vector.\n" #: src/references/exercise.md msgid "" -"// Normalize a vector by calculating its magnitude and dividing all of its\n" -"// coordinates by that magnitude.\n" +"// and taking the square root. Use the `sqrt()` method to calculate the " +"square" +msgstr "" + +#: src/references/exercise.md +msgid "// root, like `v.sqrt()`." +msgstr "" + +#: src/references/exercise.md +#, fuzzy +msgid "" +"// Normalize a vector by calculating its magnitude and dividing all of its" msgstr "" "// Normalize a vector by calculating its magnitude and dividing all of its\n" "// coordinates by that magnitude.\n" #: src/references/exercise.md -msgid "// Use the following `main` to test your work.\n" +msgid "// coordinates by that magnitude." +msgstr "" + +#: src/references/exercise.md +#, fuzzy +msgid "// Use the following `main` to test your work." msgstr "// Use the following `main` to test your work.\n" #: src/references/exercise.md src/references/solution.md @@ -4531,9 +4540,9 @@ msgstr "\"Ask a rocket scientist at NASA\"" #: src/user-defined-types/tuple-structs.md #: src/android/interoperability/cpp/cpp-bridge.md -#: src/bare-metal/microcontrollers/type-state.md #: src/async/pitfalls/cancellation.md -msgid "// ...\n" +#, fuzzy +msgid "// ..." msgstr "// ...\n" #: src/user-defined-types/tuple-structs.md @@ -4590,15 +4599,18 @@ msgid "" msgstr "`enum` 关键字允许创建具有几个 不同变体的类型:" #: src/user-defined-types/enums.md -msgid "// Simple variant\n" +#, fuzzy +msgid "// Simple variant" msgstr "// Simple variant\n" #: src/user-defined-types/enums.md -msgid "// Tuple variant\n" +#, fuzzy +msgid "// Tuple variant" msgstr "// Tuple variant\n" #: src/user-defined-types/enums.md -msgid "// Struct variant\n" +#, fuzzy +msgid "// Struct variant" msgstr "// Struct variant\n" #: src/user-defined-types/enums.md @@ -4901,7 +4913,8 @@ msgid "" msgstr "类型别名为另一种类型创建名称。这两种类型可以互换使用。" #: src/user-defined-types/aliases.md -msgid "// Aliases are more useful with long, complex types:\n" +#, fuzzy +msgid "// Aliases are more useful with long, complex types:" msgstr "// Aliases are more useful with long, complex types:\n" #: src/user-defined-types/aliases.md @@ -4935,7 +4948,7 @@ msgstr "" #: src/user-defined-types/exercise.md #, fuzzy -msgid "// TODO: add required variants\n" +msgid "// TODO: add required variants" msgstr "// Tuple variant\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md @@ -5062,15 +5075,14 @@ msgstr "" #: src/welcome-day-2.md #, fuzzy msgid "[Pattern Matching](./pattern-matching.md) (50 minutes)" -msgstr "" -"如需详细了解 Rust 中 的模式,请参阅[模式匹配](../pattern-matching.md)。" +msgstr "如需详细了解 Rust 中的模式,请参阅[模式匹配](../pattern-matching.md)。" #: src/welcome-day-2.md -msgid "[Methods and Traits](./methods-and-traits.md) (45 minutes)" +msgid "[Methods and Traits](./methods-and-traits.md) (40 minutes)" msgstr "" #: src/welcome-day-2.md -msgid "[Generics](./generics.md) (45 minutes)" +msgid "[Generics](./generics.md) (40 minutes)" msgstr "" #: src/pattern-matching.md @@ -5433,17 +5445,18 @@ msgid "[Traits](./methods-and-traits/traits.md) (10 minutes)" msgstr "" #: src/methods-and-traits.md -msgid "[Deriving](./methods-and-traits/deriving.md) (5 minutes)" +#, fuzzy +msgid "[Deriving](./methods-and-traits/deriving.md) (3 minutes)" msgstr "" +"如需详细了解 Rust 中 的模式,请参阅[模式匹配](../pattern-matching.md)。" #: src/methods-and-traits.md msgid "" "[Exercise: Generic Logger](./methods-and-traits/exercise.md) (20 minutes)" msgstr "" -#: src/methods-and-traits.md src/generics.md src/iterators.md -#: src/error-handling.md -msgid "This segment should take about 45 minutes" +#: src/methods-and-traits.md src/generics.md src/modules.md +msgid "This segment should take about 40 minutes" msgstr "" #: src/methods-and-traits/methods.md @@ -5453,15 +5466,18 @@ msgid "" msgstr "Rust 允许您将函数与新类型相关联。您可以使用“impl”块来执行此操作:" #: src/methods-and-traits/methods.md -msgid "// No receiver, a static method\n" +#, fuzzy +msgid "// No receiver, a static method" msgstr "// No receiver, a static method\n" #: src/methods-and-traits/methods.md -msgid "// Exclusive borrowed read-write access to self\n" +#, fuzzy +msgid "// Exclusive borrowed read-write access to self" msgstr "// Exclusive borrowed read-write access to self\n" #: src/methods-and-traits/methods.md -msgid "// Shared and read-only borrowed access to self\n" +#, fuzzy +msgid "// Shared and read-only borrowed access to self" msgstr "// Shared and read-only borrowed access to self\n" #: src/methods-and-traits/methods.md @@ -5473,7 +5489,8 @@ msgid "\"Lap {idx}: {lap} sec\"" msgstr "\"Lap {idx}: {lap} sec\"" #: src/methods-and-traits/methods.md -msgid "// Exclusive ownership of self\n" +#, fuzzy +msgid "// Exclusive ownership of self" msgstr "// Exclusive ownership of self\n" #: src/methods-and-traits/methods.md @@ -5485,7 +5502,8 @@ msgid "\"Monaco Grand Prix\"" msgstr "\"Monaco Grand Prix\"" #: src/methods-and-traits/methods.md -msgid "// race.add_lap(42);\n" +#, fuzzy +msgid "// race.add_lap(42);" msgstr "// race.add_lap(42);\n" #: src/methods-and-traits/methods.md @@ -5647,11 +5665,13 @@ msgid "" msgstr "系统可以自动为您的自定义类型实现支持的 trait,如下所示:" #: src/methods-and-traits/deriving.md -msgid "// Default trait adds `default` constructor.\n" +#, fuzzy +msgid "// Default trait adds `default` constructor." msgstr "// Default trait adds `default` constructor.\n" #: src/methods-and-traits/deriving.md -msgid "// Clone trait adds `clone` method.\n" +#, fuzzy +msgid "// Clone trait adds `clone` method." msgstr "// Clone trait adds `clone` method.\n" #: src/methods-and-traits/deriving.md @@ -5659,7 +5679,8 @@ msgid "\"EldurScrollz\"" msgstr "\"EldurScrollz\"" #: src/methods-and-traits/deriving.md -msgid "// Debug trait adds support for printing with `{:?}`.\n" +#, fuzzy +msgid "// Debug trait adds support for printing with `{:?}`." msgstr "// Debug trait adds support for printing with `{:?}`.\n" #: src/methods-and-traits/deriving.md @@ -5715,7 +5736,7 @@ msgid "\"Uhoh\"" msgstr "\"uhoh\"" #: src/methods-and-traits/exercise.md -msgid "// TODO: Define and implement `VerbosityFilter`.\n" +msgid "// TODO: Define and implement `VerbosityFilter`." msgstr "" #: src/methods-and-traits/solution.md @@ -5727,7 +5748,7 @@ msgid "[Generic Functions](./generics/generic-functions.md) (5 minutes)" msgstr "" #: src/generics.md -msgid "[Generic Data Types](./generics/generic-data.md) (15 minutes)" +msgid "[Generic Data Types](./generics/generic-data.md) (10 minutes)" msgstr "" #: src/generics.md @@ -5751,7 +5772,8 @@ msgstr "" "Rust 支持泛型,允许您根据算法(例如排序)中使用的类型对算法进行抽象化处理。" #: src/generics/generic-functions.md -msgid "/// Pick `even` or `odd` depending on the value of `n`.\n" +#, fuzzy +msgid "/// Pick `even` or `odd` depending on the value of `n`." msgstr "/// Pick `even` or `odd` depending on the value of `n`.\n" #: src/generics/generic-functions.md @@ -5804,7 +5826,8 @@ msgid "You can use generics to abstract over the concrete field type:" msgstr "您可以使用泛型对具体字段类型进行抽象化处理:" #: src/generics/generic-data.md -msgid "// fn set_x(&mut self, x: T)\n" +#, fuzzy +msgid "// fn set_x(&mut self, x: T)" msgstr "// fn set_x(&mut self, x: T)\n" #: src/generics/generic-data.md @@ -5866,7 +5889,8 @@ msgid "You can do this with `T: Trait` or `impl Trait`:" msgstr "您可以使用 `T: Trait` 或 `impl Trait` 执行此操作:" #: src/generics/trait-bounds.md -msgid "// struct NotClonable;\n" +#, fuzzy +msgid "// struct NotClonable;" msgstr "// struct NotClonable;\n" #: src/generics/trait-bounds.md @@ -5915,9 +5939,12 @@ msgid "" msgstr "与特征边界类似,`impl Trait` 语法可以在函数形参 和返回值中使用:" #: src/generics/impl-trait.md -msgid "" -"// Syntactic sugar for:\n" -"// fn add_42_millions>(x: T) -> i32 {\n" +msgid "// Syntactic sugar for:" +msgstr "" + +#: src/generics/impl-trait.md +#, fuzzy +msgid "// fn add_42_millions>(x: T) -> i32 {" msgstr "" "// Syntactic sugar for:\n" "// fn add_42_millions>(x: T) -> i32 {\n" @@ -5991,7 +6018,8 @@ msgid "/// Return true if self is less than other.\n" msgstr "/// Return true if self is less than other.\n" #: src/generics/exercise.md -msgid "// TODO: implement the `min` function used in `main`.\n" +#, fuzzy +msgid "// TODO: implement the `min` function used in `main`." msgstr "// TODO: implement the `min` function used in `main`.\n" #: src/generics/exercise.md src/generics/solution.md @@ -6010,6 +6038,10 @@ msgstr "" msgid "[Standard Library Traits](./std-traits.md) (1 hour and 40 minutes)" msgstr "" +#: src/welcome-day-2-afternoon.md +msgid "Including 10 minute breaks, this session should take about 3 hours" +msgstr "" + #: src/std-types.md msgid "[Standard Library](./std-types/std.md) (3 minutes)" msgstr "" @@ -6042,7 +6074,7 @@ msgstr "" msgid "[Exercise: Counter](./std-types/exercise.md) (10 minutes)" msgstr "" -#: src/std-types.md src/memory-management.md src/slices-and-lifetimes.md +#: src/std-types.md src/slices-and-lifetimes.md msgid "This segment should take about 1 hour and 10 minutes" msgstr "" @@ -6127,17 +6159,25 @@ msgid "In fact, you can document your own code:" msgstr "事实上,您可以为自己的代码编写文档:" #: src/std-types/docs.md +#, fuzzy msgid "" -"/// Determine whether the first argument is divisible by the second " -"argument.\n" -"///\n" -"/// If the second argument is zero, the result is false.\n" +"/// Determine whether the first argument is divisible by the second argument." msgstr "" "/// Determine whether the first argument is divisible by the second " "argument.\n" "///\n" "/// If the second argument is zero, the result is false.\n" +#: src/std-types/docs.md src/testing/other.md +#: src/unsafe-rust/unsafe-functions.md +#, fuzzy +msgid "///" +msgstr "//\n" + +#: src/std-types/docs.md +msgid "/// If the second argument is zero, the result is false." +msgstr "" + #: src/std-types/docs.md #, fuzzy msgid "" @@ -6160,9 +6200,9 @@ msgstr "" "为“内部文档注释”:" #: src/std-types/docs.md +#, fuzzy msgid "" -"//! This module contains functionality relating to divisibility of " -"integers.\n" +"//! This module contains functionality relating to divisibility of integers." msgstr "" "//! This module contains functionality relating to divisibility of " "integers.\n" @@ -6437,6 +6477,15 @@ msgid "" msgstr "" "通过使用“s3\\[0..4\\]”转换为子字符串,其中该 Slice 在或不在字符边界上。" +#: src/std-types/string.md +msgid "" +"Many types can be converted to a string with the [`to_string`](https://doc." +"rust-lang.org/std/string/trait.ToString.html#tymethod.to_string) method. " +"This trait is automatically implemented for all types that implement " +"`Display`, so anything that can be formatted can also be converted to a " +"string." +msgstr "" + #: src/std-types/vec.md msgid "" "[`Vec`](https://doc.rust-lang.org/std/vec/struct.Vec.html) is the standard " @@ -6454,11 +6503,13 @@ msgid "\"v2: len = {}, capacity = {}\"" msgstr "\"v2: len = {}, capacity = {}\"" #: src/std-types/vec.md -msgid "// Canonical macro to initialize a vector with elements.\n" +#, fuzzy +msgid "// Canonical macro to initialize a vector with elements." msgstr "// Canonical macro to initialize a vector with elements.\n" #: src/std-types/vec.md -msgid "// Retain only the even elements.\n" +#, fuzzy +msgid "// Retain only the even elements." msgstr "// Retain only the even elements.\n" #: src/std-types/vec.md @@ -6466,7 +6517,8 @@ msgid "\"{v3:?}\"" msgstr "\"{v3:?}\"" #: src/std-types/vec.md -msgid "// Remove consecutive duplicates.\n" +#, fuzzy +msgid "// Remove consecutive duplicates." msgstr "// Remove consecutive duplicates.\n" #: src/std-types/vec.md @@ -6563,7 +6615,8 @@ msgid "\"{book} is unknown.\"" msgstr "\"{book} is unknown.\"" #: src/std-types/hashmap.md -msgid "// Use the .entry() method to insert a value if nothing is found.\n" +#, fuzzy +msgid "// Use the .entry() method to insert a value if nothing is found." msgstr "// Use the .entry() method to insert a value if nothing is found.\n" #: src/std-types/hashmap.md @@ -6672,22 +6725,26 @@ msgstr "" "collections/struct.HashMap.html#method.entry) 方法将哈希查找次数减半,从而实" "现 `count` 方法。" -#: src/std-types/exercise.md src/std-types/solution.md +#: src/std-types/exercise.md +#, fuzzy msgid "" -"/// Counter counts the number of times each value of type T has been seen.\n" +"/// Counter counts the number of times each value of type T has been seen." msgstr "" "/// Counter counts the number of times each value of type T has been seen.\n" -#: src/std-types/exercise.md src/std-types/solution.md -msgid "/// Create a new Counter.\n" +#: src/std-types/exercise.md +#, fuzzy +msgid "/// Create a new Counter." msgstr "/// Create a new Counter.\n" -#: src/std-types/exercise.md src/std-types/solution.md -msgid "/// Count an occurrence of the given value.\n" +#: src/std-types/exercise.md +#, fuzzy +msgid "/// Count an occurrence of the given value." msgstr "/// Count an occurrence of the given value.\n" -#: src/std-types/exercise.md src/std-types/solution.md -msgid "/// Return the number of times the given value has been seen.\n" +#: src/std-types/exercise.md +#, fuzzy +msgid "/// Return the number of times the given value has been seen." msgstr "/// Return the number of times the given value has been seen.\n" #: src/std-types/exercise.md src/std-types/solution.md @@ -6706,6 +6763,24 @@ msgstr "\"orange\"" msgid "\"got {} apples\"" msgstr "\"got {} apples\"" +#: src/std-types/solution.md +msgid "" +"/// Counter counts the number of times each value of type T has been seen.\n" +msgstr "" +"/// Counter counts the number of times each value of type T has been seen.\n" + +#: src/std-types/solution.md +msgid "/// Create a new Counter.\n" +msgstr "/// Create a new Counter.\n" + +#: src/std-types/solution.md +msgid "/// Count an occurrence of the given value.\n" +msgstr "/// Count an occurrence of the given value.\n" + +#: src/std-types/solution.md +msgid "/// Return the number of times the given value has been seen.\n" +msgstr "/// Return the number of times the given value has been seen.\n" + #: src/std-traits.md msgid "[Comparisons](./std-traits/comparisons.md) (10 minutes)" msgstr "" @@ -7213,7 +7288,8 @@ msgstr "" "以确保结果仍为有效的 UTF-8 编码字符。" #: src/std-traits/exercise.md -msgid "// Implement the `Read` trait for `RotDecoder`.\n" +#, fuzzy +msgid "// Implement the `Read` trait for `RotDecoder`." msgstr "// Implement the `Read` trait for `RotDecoder`.\n" #: src/std-traits/exercise.md src/std-traits/solution.md @@ -7267,16 +7343,16 @@ msgid "[Welcome](./welcome-day-3.md) (3 minutes)" msgstr "" #: src/welcome-day-3.md -msgid "[Memory Management](./memory-management.md) (1 hour and 10 minutes)" +msgid "[Memory Management](./memory-management.md) (1 hour)" msgstr "" #: src/welcome-day-3.md msgid "[Smart Pointers](./smart-pointers.md) (55 minutes)" msgstr "" -#: src/welcome-day-3.md +#: src/welcome-day-3.md src/welcome-day-3-afternoon.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 25 " +"Including 10 minute breaks, this session should take about 2 hours and 20 " "minutes" msgstr "" @@ -7295,7 +7371,7 @@ msgid "[Ownership](./memory-management/ownership.md) (5 minutes)" msgstr "" #: src/memory-management.md -msgid "[Move Semantics](./memory-management/move.md) (10 minutes)" +msgid "[Move Semantics](./memory-management/move.md) (5 minutes)" msgstr "" #: src/memory-management.md @@ -7399,17 +7475,24 @@ msgid "\"world\"" msgstr "\"world\"" #: src/memory-management/review.md +msgid "// DON'T DO THIS AT HOME! For educational purposes only." +msgstr "" + +#: src/memory-management/review.md +#, fuzzy msgid "" -"// DON'T DO THIS AT HOME! For educational purposes only.\n" -" // String provides no guarantees about its layout, so this could lead " -"to\n" -" // undefined behavior.\n" +"// String provides no guarantees about its layout, so this could lead to" msgstr "" "// DON'T DO THIS AT HOME!For educational purposes only.\n" " // String provides no guarantees about its layout, so this could lead " "to\n" " // undefined behavior.\n" +#: src/memory-management/review.md +#, fuzzy +msgid "// undefined behavior." +msgstr "Rust 没有运行时未定义行为:" + #: src/memory-management/review.md msgid "\"ptr = {ptr:#x}, len = {len}, capacity = {capacity}\"" msgstr "\"ptr = {ptr:#x}, len = {len}, capacity = {capacity}\"" @@ -7561,7 +7644,8 @@ msgid "\"s2: {s2}\"" msgstr "\"s2: {s2}\"" #: src/memory-management/move.md -msgid "// println!(\"s1: {s1}\");\n" +#, fuzzy +msgid "// println!(\"s1: {s1}\");" msgstr "// println!(\"s1: {s1}\");\n" #: src/memory-management/move.md @@ -7645,7 +7729,8 @@ msgid "\"Alice\"" msgstr "切片" #: src/memory-management/move.md -msgid "// say_hello(name);\n" +#, fuzzy +msgid "// say_hello(name);" msgstr "// say_hello(name);\n" #: src/memory-management/move.md @@ -7728,7 +7813,8 @@ msgid "\"Cpp\"" msgstr "\"Cpp\"" #: src/memory-management/move.md -msgid "// Duplicate the data in s1.\n" +#, fuzzy +msgid "// Duplicate the data in s1." msgstr "// Duplicate the data in s1.\n" #: src/memory-management/move.md @@ -8102,10 +8188,6 @@ msgstr "" msgid "[Exercise: Binary Tree](./smart-pointers/exercise.md) (30 minutes)" msgstr "" -#: src/smart-pointers.md -msgid "This segment should take about 55 minutes" -msgstr "" - #: src/smart-pointers/box.md msgid "" "[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) is an owned " @@ -8134,11 +8216,11 @@ msgid "" msgstr "递归数据类型或具有动态大小的数据类型需要使用 `Box`:" #: src/smart-pointers/box.md -msgid "/// A non-empty list: first element and the rest of the list.\n" +msgid "/// A non-empty list: first element and the rest of the list." msgstr "" #: src/smart-pointers/box.md -msgid "/// An empty list.\n" +msgid "/// An empty list." msgstr "" #: src/smart-pointers/box.md @@ -8581,7 +8663,7 @@ msgstr "" #: src/smart-pointers/exercise.md #, fuzzy -msgid "// Implement `new`, `insert`, `len`, and `has`.\n" +msgid "// Implement `new`, `insert`, `len`, and `has`." msgstr "// Implement `new`, `insert`, and `has`.\n" #: src/smart-pointers/exercise.md src/smart-pointers/solution.md @@ -8604,12 +8686,6 @@ msgid "" "[Slices and Lifetimes](./slices-and-lifetimes.md) (1 hour and 10 minutes)" msgstr "" -#: src/welcome-day-3-afternoon.md -msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 20 " -"minutes" -msgstr "" - #: src/borrowing.md msgid "[Borrowing a Value](./borrowing/shared.md) (10 minutes)" msgstr "" @@ -9132,7 +9208,8 @@ msgid "" msgstr "当考虑向函数传递值和从函数返回值时,生命周期会变得更加复杂。" #: src/slices-and-lifetimes/lifetime-annotations.md -msgid "// What is the lifetime of p3?\n" +#, fuzzy +msgid "// What is the lifetime of p3?" msgstr "// What is the lifetime of p3?\n" #: src/slices-and-lifetimes/lifetime-annotations.md @@ -9255,7 +9332,8 @@ msgid "\"The quick brown fox jumps over the lazy dog.\"" msgstr "\"The quick brown fox jumps over the lazy dog.\"" #: src/slices-and-lifetimes/struct-lifetimes.md -msgid "// erase(text);\n" +#, fuzzy +msgid "// erase(text);" msgstr "// erase(text);\n" #: src/slices-and-lifetimes/struct-lifetimes.md @@ -9486,8 +9564,9 @@ msgstr "" "/// The entire input is consumed.\n" #: src/slices-and-lifetimes/exercise.md -msgid "// TODO: Implement ProtoMessage for Person and PhoneNumber.\n" -msgstr "" +#, fuzzy +msgid "// TODO: Implement ProtoMessage for Person and PhoneNumber." +msgstr "// TODO: Implement `Widget` for `Label`.\n" #: src/slices-and-lifetimes/solution.md msgid "// Unwrap error because `value` is definitely 4 bytes long.\n" @@ -9547,12 +9626,15 @@ msgid "[Modules](./modules.md) (40 minutes)" msgstr "" #: src/welcome-day-4.md -msgid "[Testing](./testing.md) (1 hour and 5 minutes)" +#, fuzzy +msgid "[Testing](./testing.md) (1 hour)" msgstr "" +"借用:\n" +"请参阅 [借用](ownership/borrowing.md)。" #: src/welcome-day-4.md msgid "" -"Including 10 minute breaks, this session should take about 3 hours and 5 " +"Including 10 minute breaks, this session should take about 2 hours and 50 " "minutes" msgstr "" @@ -9574,6 +9656,10 @@ msgid "" "[Exercise: Iterator Method Chaining](./iterators/exercise.md) (30 minutes)" msgstr "练习:迭代器方法链接" +#: src/iterators.md src/error-handling.md +msgid "This segment should take about 45 minutes" +msgstr "" + #: src/iterators/iterator.md msgid "" "The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " @@ -9778,8 +9864,9 @@ msgstr "" "/// Element `n` of the result is `values[(n+offset)%len] - values[n]`.\n" #: src/modules.md -msgid "[Modules](./modules/modules.md) (5 minutes)" -msgstr "" +#, fuzzy +msgid "[Modules](./modules/modules.md) (3 minutes)" +msgstr "练习:面向 GUI 库的模块" #: src/modules.md msgid "[Filesystem Hierarchy](./modules/filesystem.md) (5 minutes)" @@ -9799,10 +9886,6 @@ msgid "" "[Exercise: Modules for a GUI Library](./modules/exercise.md) (15 minutes)" msgstr "练习:面向 GUI 库的模块" -#: src/modules.md -msgid "This segment should take about 40 minutes" -msgstr "" - #: src/modules/modules.md msgid "We have seen how `impl` blocks let us namespace functions to a type." msgstr "我们已看了“impl”块如何让我们将函数的命名空间建为一种类型。" @@ -9875,25 +9958,33 @@ msgstr "" "(在本例中为模块)。" #: src/modules/filesystem.md +#, fuzzy msgid "" "//! This module implements the garden, including a highly performant " -"germination\n" -"//! implementation.\n" +"germination" msgstr "" "//! This module implements the garden, including a highly performant " "germination\n" "//! implementation.\n" #: src/modules/filesystem.md -msgid "// Re-export types from this module.\n" +#, fuzzy +msgid "//! implementation." +msgstr "实现" + +#: src/modules/filesystem.md +#, fuzzy +msgid "// Re-export types from this module." msgstr "// Re-export types from this module.\n" #: src/modules/filesystem.md -msgid "/// Sow the given seed packets.\n" +#, fuzzy +msgid "/// Sow the given seed packets." msgstr "/// Sow the given seed packets.\n" #: src/modules/filesystem.md -msgid "/// Harvest the produce in the garden that is ready.\n" +#, fuzzy +msgid "/// Harvest the produce in the garden that is ready." msgstr "/// Harvest the produce in the garden that is ready.\n" #: src/modules/filesystem.md @@ -10128,15 +10219,15 @@ msgstr "" msgid "Here's the single-module implementation of the GUI library:" msgstr "" -#: src/modules/exercise.md src/modules/solution.md +#: src/modules/exercise.md msgid "/// Natural width of `self`.\n" msgstr "/// Natural width of `self`.\n" -#: src/modules/exercise.md src/modules/solution.md +#: src/modules/exercise.md msgid "/// Draw the widget into a buffer.\n" msgstr "/// Draw the widget into a buffer.\n" -#: src/modules/exercise.md src/modules/solution.md +#: src/modules/exercise.md msgid "/// Draw the widget on standard output.\n" msgstr "/// Draw the widget on standard output.\n" @@ -10180,7 +10271,7 @@ msgstr "\"+={:=. Then use\n" -" // the ?-operator here instead of .unwrap().\n" +#, fuzzy +msgid "// Add 4 paddings for borders" +msgstr "// Add 4 paddings for borders\n" + +#: src/modules/solution.md +#, fuzzy +msgid "// ANCHOR: Window-draw_into" +msgstr "// ANCHOR:Window-draw_into\n" + +#: src/modules/solution.md +#, fuzzy +msgid "// ANCHOR_END: Window-draw_into" +msgstr "// ANCHOR_END:Window-draw_into\n" + +#: src/modules/solution.md +msgid "// TODO: after learning about error handling, you can change" +msgstr "" + +#: src/modules/solution.md +#, fuzzy +msgid "// draw_into to return Result<(), std::fmt::Error>. Then use" msgstr "" "// TODO: after learning about error handling, you can change\n" " // draw_into to return Result<(), std::fmt::Error>. Then use\n" " // the ?-operator here instead of .unwrap().\n" #: src/modules/solution.md -msgid "// ---- src/main.rs ----\n" +msgid "// the ?-operator here instead of .unwrap()." +msgstr "" + +#: src/modules/solution.md +#, fuzzy +msgid "// ---- src/main.rs ----" msgstr "// ---- src/main.rs ----\n" #: src/testing.md @@ -10288,7 +10420,7 @@ msgid "[Test Modules](./testing/unit-tests.md) (5 minutes)" msgstr "" #: src/testing.md -msgid "[Other Types of Tests](./testing/other.md) (10 minutes)" +msgid "[Other Types of Tests](./testing/other.md) (5 minutes)" msgstr "" #: src/testing.md @@ -10304,7 +10436,7 @@ msgid "[Mocking](./testing/mocking.md) (5 minutes)" msgstr "" #: src/testing.md -msgid "[Compiler Lints and Clippy](./testing/lints.md) (5 minutes)" +msgid "[Compiler Lints and Clippy](./testing/lints.md) (3 minutes)" msgstr "" #: src/testing.md @@ -10367,7 +10499,8 @@ msgid "Create a `.rs` file under `tests/`:" msgstr "在 `tests/` 下方创建一个 `.rs` 文件:" #: src/testing/other.md -msgid "// tests/my_library.rs\n" +#, fuzzy +msgid "// tests/my_library.rs" msgstr "// tests/my_library.rs\n" #: src/testing/other.md @@ -10383,22 +10516,25 @@ msgid "Rust has built-in support for documentation tests:" msgstr "Rust 本身就支持文档测试:" #: src/testing/other.md -msgid "" -"/// Shortens a string to the given length.\n" -"///\n" -"/// ```\n" -"/// # use playground::shorten_string;\n" -"/// assert_eq!(shorten_string(\"Hello World\", 5), \"Hello\");\n" -"/// assert_eq!(shorten_string(\"Hello World\", 20), \"Hello World\");\n" -"/// ```\n" +#, fuzzy +msgid "/// Shortens a string to the given length." +msgstr "/// The car has arrived on the given floor.\n" + +#: src/testing/other.md +msgid "/// ```" +msgstr "" + +#: src/testing/other.md +msgid "/// # use playground::shorten_string;" +msgstr "" + +#: src/testing/other.md +msgid "/// assert_eq!(shorten_string(\"Hello World\", 5), \"Hello\");" +msgstr "" + +#: src/testing/other.md +msgid "/// assert_eq!(shorten_string(\"Hello World\", 20), \"Hello World\");" msgstr "" -"/// Shortens a string to the given length.\n" -"///\n" -"/// ```\n" -"/// # use playground::shorten_string;\n" -"/// assert_eq!(shorten_string(\"Hello World\", 5), \"Hello\");\n" -"/// assert_eq!(shorten_string(\"Hello World\", 20), \"Hello World\");\n" -"/// ```\n" #: src/testing/other.md msgid "Code blocks in `///` comments are automatically seen as Rust code." @@ -10673,7 +10809,8 @@ msgstr "" "字符串作为输入内容,并执行以下操作来验证信用卡号:" #: src/testing/exercise.md -msgid "Ignore all spaces. Reject number with less than two digits." +#, fuzzy +msgid "Ignore all spaces. Reject number with fewer than two digits." msgstr "忽略所有空格。拒绝少于两位的号码。" #: src/testing/exercise.md @@ -10927,7 +11064,8 @@ msgid "We can use this to simplify our error handling code:" msgstr "我们可以用它来简化错误处理代码:" #: src/error-handling/try.md -msgid "//fs::write(\"config.dat\", \"alice\").unwrap();\n" +#, fuzzy +msgid "//fs::write(\"config.dat\", \"alice\").unwrap();" msgstr "//fs::write(\"config.dat\", \"alice\").unwrap();\n" #: src/error-handling/try.md src/error-handling/try-conversions.md @@ -10996,7 +11134,8 @@ msgstr "\"Found no username in {0}\"" #: src/error-handling/try-conversions.md #: src/error-handling/thiserror-and-anyhow.md -msgid "//fs::write(\"config.dat\", \"\").unwrap();\n" +#, fuzzy +msgid "//fs::write(\"config.dat\", \"\").unwrap();" msgstr "//fs::write(\"config.dat\", \"\").unwrap();\n" #: src/error-handling/try-conversions.md @@ -11338,6 +11477,10 @@ msgstr "" msgid "[Exercise: FFI Wrapper](./unsafe-rust/exercise.md) (30 minutes)" msgstr "" +#: src/unsafe-rust.md +msgid "This segment should take about 1 hour and 5 minutes" +msgstr "" + #: src/unsafe-rust/unsafe.md msgid "The Rust language has two parts:" msgstr "Rust 语言包含两个部分:" @@ -11422,20 +11565,25 @@ msgid "\"careful!\"" msgstr "\"careful!\"" #: src/unsafe-rust/dereferencing.md -msgid "" -"// Safe because r1 and r2 were obtained from references and so are\n" -" // guaranteed to be non-null and properly aligned, the objects " -"underlying\n" -" // the references from which they were obtained are live throughout the\n" -" // whole unsafe block, and they are not accessed either through the\n" -" // references or concurrently through any other pointers.\n" +msgid "// Safe because r1 and r2 were obtained from references and so are" +msgstr "" + +#: src/unsafe-rust/dereferencing.md +msgid "" +"// guaranteed to be non-null and properly aligned, the objects underlying" +msgstr "" + +#: src/unsafe-rust/dereferencing.md +msgid "// the references from which they were obtained are live throughout the" +msgstr "" + +#: src/unsafe-rust/dereferencing.md +msgid "// whole unsafe block, and they are not accessed either through the" +msgstr "" + +#: src/unsafe-rust/dereferencing.md +msgid "// references or concurrently through any other pointers." msgstr "" -"// Safe because r1 and r2 were obtained from references and so are\n" -" // guaranteed to be non-null and properly aligned, the objects " -"underlying\n" -" // the references from which they were obtained are live throughout the\n" -" // whole unsafe block, and they are not accessed either through the\n" -" // references or concurrently through any other pointers.\n" #: src/unsafe-rust/dereferencing.md msgid "\"r1 is: {}\"" @@ -11450,20 +11598,12 @@ msgid "\"r2 is: {}\"" msgstr "\"r2 is: {}\"" #: src/unsafe-rust/dereferencing.md -msgid "" -"// NOT SAFE. DO NOT DO THIS.\n" -" /*\n" -" let r3: &String = unsafe { &*r1 };\n" -" drop(s);\n" -" println!(\"r3 is: {}\", *r3);\n" -" */" +msgid "// NOT SAFE. DO NOT DO THIS." +msgstr "" + +#: src/unsafe-rust/dereferencing.md +msgid "/*" msgstr "" -"// NOT SAFE. DO NOT DO THIS.\n" -" /*\n" -" let r3: &String = unsafe { &*r1 };\n" -" drop(s);\n" -" println!(\"r3 is: {}\", *r3);\n" -" */" #: src/unsafe-rust/dereferencing.md msgid "" @@ -11580,7 +11720,7 @@ msgstr "\"bool: {}\"" #: src/unsafe-rust/unions.md #, fuzzy -msgid "// Undefined behavior!\n" +msgid "// Undefined behavior!" msgstr "Rust 没有运行时未定义行为:" #: src/unsafe-rust/unions.md @@ -11630,13 +11770,17 @@ msgid "\"🗻∈🌏\"" msgstr "\"🗻∈🌏\"" #: src/unsafe-rust/unsafe-functions.md +#, fuzzy msgid "" -"// Safe because the indices are in the correct order, within the bounds of\n" -" // the string slice, and lie on UTF-8 sequence boundaries.\n" +"// Safe because the indices are in the correct order, within the bounds of" msgstr "" "// Safe because the indices are in the correct order, within the bounds of\n" " // the string slice, and lie on UTF-8 sequence boundaries.\n" +#: src/unsafe-rust/unsafe-functions.md +msgid "// the string slice, and lie on UTF-8 sequence boundaries." +msgstr "" + #: src/unsafe-rust/unsafe-functions.md msgid "\"emoji: {}\"" msgstr "\"emoji: {}\"" @@ -11647,7 +11791,7 @@ msgstr "\"char count: {}\"" #: src/unsafe-rust/unsafe-functions.md #, fuzzy -msgid "// Undefined behavior if abs misbehaves.\n" +msgid "// Undefined behavior if abs misbehaves." msgstr "Rust 没有运行时未定义行为:" #: src/unsafe-rust/unsafe-functions.md @@ -11655,17 +11799,20 @@ msgid "\"Absolute value of -3 according to C: {}\"" msgstr "\"Absolute value of -3 according to C: {}\"" #: src/unsafe-rust/unsafe-functions.md -#, fuzzy -msgid "" -"// Not upholding the UTF-8 encoding requirement breaks memory safety!\n" -" // println!(\"emoji: {}\", unsafe { emojis.get_unchecked(0..3) });\n" -" // println!(\"char count: {}\", count_chars(unsafe {\n" -" // emojis.get_unchecked(0..3) }));\n" +msgid "// Not upholding the UTF-8 encoding requirement breaks memory safety!" +msgstr "" + +#: src/unsafe-rust/unsafe-functions.md +msgid "// println!(\"emoji: {}\", unsafe { emojis.get_unchecked(0..3) });" +msgstr "" + +#: src/unsafe-rust/unsafe-functions.md +msgid "// println!(\"char count: {}\", count_chars(unsafe {" +msgstr "" + +#: src/unsafe-rust/unsafe-functions.md +msgid "// emojis.get_unchecked(0..3) }));" msgstr "" -"// Not upholding the UTF-8 encoding requirement breaks memory safety!\n" -" // println!(\"emoji: {}\", unsafe { emojis.get_unchecked(0..3) });\n" -" // println!(\"char count: {}\", count_chars(unsafe { emojis." -"get_unchecked(0..3) }));\n" #: src/unsafe-rust/unsafe-functions.md msgid "Writing Unsafe Functions" @@ -11680,21 +11827,21 @@ msgstr "" "为 `unsafe`。" #: src/unsafe-rust/unsafe-functions.md -msgid "" -"/// Swaps the values pointed to by the given pointers.\n" -"///\n" -"/// # Safety\n" -"///\n" -"/// The pointers must be valid and properly aligned.\n" +msgid "/// Swaps the values pointed to by the given pointers." +msgstr "" + +#: src/unsafe-rust/unsafe-functions.md src/unsafe-rust/unsafe-traits.md +msgid "/// # Safety" msgstr "" -"/// Swaps the values pointed to by the given pointers.\n" -"///\n" -"/// # Safety\n" -"///\n" -"/// The pointers must be valid and properly aligned.\n" #: src/unsafe-rust/unsafe-functions.md -msgid "// Safe because ...\n" +#, fuzzy +msgid "/// The pointers must be valid and properly aligned." +msgstr "在大多数情况下,指针还必须正确对齐。" + +#: src/unsafe-rust/unsafe-functions.md +#, fuzzy +msgid "// Safe because ..." msgstr "// Safe because ...\n" #: src/unsafe-rust/unsafe-functions.md @@ -11762,17 +11909,21 @@ msgstr "" "docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):" #: src/unsafe-rust/unsafe-traits.md -msgid "" -"/// ...\n" -"/// # Safety\n" -"/// The type must have a defined representation and no padding.\n" +#, fuzzy +msgid "/// ..." +msgstr "// ...\n" + +#: src/unsafe-rust/unsafe-traits.md +#, fuzzy +msgid "/// The type must have a defined representation and no padding." msgstr "" "/// ...\n" "/// # Safety\n" "/// The type must have a defined representation and no padding.\n" #: src/unsafe-rust/unsafe-traits.md -msgid "// Safe because u32 has a defined representation and no padding.\n" +#, fuzzy +msgid "// Safe because u32 has a defined representation and no padding." msgstr "// Safe because u32 has a defined representation and no padding.\n" #: src/unsafe-rust/unsafe-traits.md @@ -11996,20 +12147,23 @@ msgstr "" msgid "\"readdir$INODE64\"" msgstr "\"readdir$INODE64\"" -#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md +#: src/unsafe-rust/exercise.md +#, fuzzy msgid "" "// Call opendir and return a Ok value if that worked,\n" -" // otherwise return Err with a message.\n" +" // otherwise return Err with a message." msgstr "" "// Call opendir and return a Ok value if that worked,\n" " // otherwise return Err with a message.\n" #: src/unsafe-rust/exercise.md -msgid "// Keep calling readdir until we get a NULL pointer back.\n" +#, fuzzy +msgid "// Keep calling readdir until we get a NULL pointer back." msgstr "// Keep calling readdir until we get a NULL pointer back.\n" -#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md -msgid "// Call closedir as needed.\n" +#: src/unsafe-rust/exercise.md +#, fuzzy +msgid "// Call closedir as needed." msgstr "// Call closedir as needed.\n" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md @@ -12021,6 +12175,14 @@ msgstr "\".\"" msgid "\"files: {:#?}\"" msgstr "\"files: {:#?}\"" +#: src/unsafe-rust/solution.md +msgid "" +"// Call opendir and return a Ok value if that worked,\n" +" // otherwise return Err with a message.\n" +msgstr "" +"// Call opendir and return a Ok value if that worked,\n" +" // otherwise return Err with a message.\n" + #: src/unsafe-rust/solution.md msgid "\"Invalid path: {err}\"" msgstr "\"Invalid path: {err}\"" @@ -12053,6 +12215,10 @@ msgstr "" "// SAFETY: dirent is not NULL and dirent.d_name is NUL\n" " // terminated.\n" +#: src/unsafe-rust/solution.md +msgid "// Call closedir as needed.\n" +msgstr "// Call closedir as needed.\n" + #: src/unsafe-rust/solution.md msgid "// SAFETY: self.dir is not NULL.\n" msgstr "// SAFETY: self.dir is not NULL.\n" @@ -13605,9 +13771,15 @@ msgstr "" "这些内容会被用作 `cc_library_static` 的输入。" #: src/android/interoperability/cpp/android-cpp-genrules.md -msgid "" +#, fuzzy +msgid "// Generate a C++ header containing the C++ bindings" +msgstr "" "// Generate a C++ header containing the C++ bindings\n" "// to the Rust exported functions in lib.rs.\n" + +#: src/android/interoperability/cpp/android-cpp-genrules.md +#, fuzzy +msgid "// to the Rust exported functions in lib.rs." msgstr "" "// Generate a C++ header containing the C++ bindings\n" "// to the Rust exported functions in lib.rs.\n" @@ -13632,7 +13804,8 @@ msgid "\"lib.rs.h\"" msgstr "\"lib.rs.h\"" #: src/android/interoperability/cpp/android-cpp-genrules.md -msgid "// Generate the C++ code that Rust calls into.\n" +#, fuzzy +msgid "// Generate the C++ code that Rust calls into." msgstr "// Generate the C++ code that Rust calls into.\n" #: src/android/interoperability/cpp/android-cpp-genrules.md @@ -14923,7 +15096,8 @@ msgid "\"example/include/blobstore.h\"" msgstr "\"example/include/blobstore.h\"" #: src/chromium/interoperability-with-cpp/example-bindings.md -msgid "// Definitions of Rust types and functions go here\n" +#, fuzzy +msgid "// Definitions of Rust types and functions go here" msgstr "// Definitions of Rust types and functions go here\n" #: src/chromium/interoperability-with-cpp/example-bindings.md @@ -15139,17 +15313,19 @@ msgid "\"gfx::rust_bindings\"" msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-png.md -msgid "" -"/// This returns an FFI-friendly equivalent of `Result,\n" -" /// ()>`.\n" +msgid "/// This returns an FFI-friendly equivalent of `Result," msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-png.md -msgid "/// C++ bindings for the `crate::png::ResultOfPngReader` type.\n" +msgid "/// ()>`." msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-png.md -msgid "/// C++ bindings for the `crate::png::PngReader` type.\n" +msgid "/// C++ bindings for the `crate::png::ResultOfPngReader` type." +msgstr "" + +#: src/chromium/interoperability-with-cpp/error-handling-png.md +msgid "/// C++ bindings for the `crate::png::PngReader` type." msgstr "" #: src/chromium/interoperability-with-cpp/error-handling-png.md @@ -16754,6 +16930,10 @@ msgstr "类型状态模式" msgid "// let gpio0_01_again = gpio0.p0_01; // Error, moved.\n" msgstr "// let gpio0_01_again = gpio0.p0_01; // Error, moved.\n" +#: src/bare-metal/microcontrollers/type-state.md +msgid "// ...\n" +msgstr "// ...\n" + #: src/bare-metal/microcontrollers/type-state.md msgid "// pin_input.is_high(); // Error, moved.\n" msgstr "// pin_input.is_high(); // Error, moved.\n" @@ -17141,12 +17321,13 @@ msgid "// Use the system timer as a delay provider.\n" msgstr "" #: src/exercises/bare-metal/compass.md -msgid "" -"// Set up the I2C controller and Inertial Measurement Unit.\n" -" // TODO\n" +#, fuzzy +msgid "// Set up the I2C controller and Inertial Measurement Unit." +msgstr "// Set up the I2C controller and Inertial Measurement Unit.\n" + +#: src/exercises/bare-metal/compass.md +msgid "// TODO" msgstr "" -"// Set up the I2C controller and Inertial Measurement Unit.\n" -" // TODO\n" #: src/exercises/bare-metal/compass.md #: src/exercises/bare-metal/solutions-morning.md @@ -17154,12 +17335,9 @@ msgid "\"Ready.\"" msgstr "\"Ready.\"" #: src/exercises/bare-metal/compass.md -msgid "" -"// Read compass data and log it to the serial port.\n" -" // TODO\n" -msgstr "" -"// Read compass data and log it to the serial port.\n" -" // TODO\n" +#, fuzzy +msgid "// Read compass data and log it to the serial port." +msgstr "// Read compass data and log it to the serial port.\n" #: src/exercises/bare-metal/compass.md src/exercises/bare-metal/rtc.md msgid "_Cargo.toml_ (you shouldn't need to change this):" @@ -18378,15 +18556,18 @@ msgstr "" "根据 AArch64 虚拟内存系统架构创建分页表。" #: src/bare-metal/useful-crates/aarch64-paging.md -msgid "// Create a new page table with identity mapping.\n" +#, fuzzy +msgid "// Create a new page table with identity mapping." msgstr "// Create a new page table with identity mapping.\n" #: src/bare-metal/useful-crates/aarch64-paging.md -msgid "// Map a 2 MiB region of memory as read-only.\n" +#, fuzzy +msgid "// Map a 2 MiB region of memory as read-only." msgstr "// Map a 2 MiB region of memory as read-only.\n" #: src/bare-metal/useful-crates/aarch64-paging.md -msgid "// Set `TTBR0_EL1` to activate the page table.\n" +#, fuzzy +msgid "// Set `TTBR0_EL1` to activate the page table." msgstr "// Set `TTBR0_EL1` to activate the page table.\n" #: src/bare-metal/useful-crates/aarch64-paging.md @@ -18647,11 +18828,13 @@ msgstr "" " // nothing else accesses those address ranges.\n" #: src/exercises/bare-metal/rtc.md -msgid "// TODO: Create instance of RTC driver and print current time.\n" +#, fuzzy +msgid "// TODO: Create instance of RTC driver and print current time." msgstr "// TODO: Create instance of RTC driver and print current time.\n" #: src/exercises/bare-metal/rtc.md -msgid "// TODO: Wait for 3 seconds.\n" +#, fuzzy +msgid "// TODO: Wait for 3 seconds." msgstr "// TODO: Wait for 3 seconds.\n" #: src/exercises/bare-metal/rtc.md @@ -20636,7 +20819,8 @@ msgid "Let us see `Arc` and `Mutex` in action:" msgstr "让我们看看 `Arc` 和 `Mutex` 的实际效果:" #: src/concurrency/shared_state/example.md -msgid "// use std::sync::{Arc, Mutex};\n" +#, fuzzy +msgid "// use std::sync::{Arc, Mutex};" msgstr "// use std::sync::{Arc, Mutex};\n" #: src/concurrency/shared_state/example.md @@ -20721,14 +20905,18 @@ msgstr "" #: src/exercises/concurrency/dining-philosophers.md #: src/exercises/concurrency/dining-philosophers-async.md -msgid "" -"// left_fork: ...\n" -" // right_fork: ...\n" -" // thoughts: ...\n" +msgid "// left_fork: ..." +msgstr "" + +#: src/exercises/concurrency/dining-philosophers.md +#: src/exercises/concurrency/dining-philosophers-async.md +msgid "// right_fork: ..." +msgstr "" + +#: src/exercises/concurrency/dining-philosophers.md +#: src/exercises/concurrency/dining-philosophers-async.md +msgid "// thoughts: ..." msgstr "" -"// left_fork: ...\n" -" // right_fork: ...\n" -" // thoughts: ...\n" #: src/exercises/concurrency/dining-philosophers.md #: src/exercises/concurrency/solutions-morning.md @@ -20738,9 +20926,8 @@ msgid "\"Eureka! {} has a new idea!\"" msgstr "\"Eureka! {} has a new idea!\"" #: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md -msgid "// Pick up forks...\n" +#, fuzzy +msgid "// Pick up forks..." msgstr "// Pick up forks...\n" #: src/exercises/concurrency/dining-philosophers.md @@ -20788,24 +20975,25 @@ msgstr "\"Pythagoras\"" #: src/exercises/concurrency/dining-philosophers.md #: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md -msgid "// Create forks\n" +#, fuzzy +msgid "// Create forks" msgstr "// Create forks\n" #: src/exercises/concurrency/dining-philosophers.md #: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md -msgid "// Create philosophers\n" +#, fuzzy +msgid "// Create philosophers" msgstr "// Create philosophers\n" #: src/exercises/concurrency/dining-philosophers.md -msgid "// Make each of them think and eat 100 times\n" +#, fuzzy +msgid "// Make each of them think and eat 100 times" msgstr "// Make each of them think and eat 100 times\n" #: src/exercises/concurrency/dining-philosophers.md #: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md -msgid "// Output their thoughts\n" +#, fuzzy +msgid "// Output their thoughts" msgstr "// Output their thoughts\n" #: src/exercises/concurrency/dining-philosophers.md @@ -21772,19 +21960,24 @@ msgid "" msgstr "" #: src/async/pitfalls/pin.md -msgid "" -"// A work item. In this case, just sleep for the given time and respond\n" -"// with a message on the `respond_on` channel.\n" +#, fuzzy +msgid "// A work item. In this case, just sleep for the given time and respond" msgstr "" "// A work item. In this case, just sleep for the given time and respond\n" "// with a message on the `respond_on` channel.\n" #: src/async/pitfalls/pin.md -msgid "// A worker which listens for work on a queue and performs it.\n" +msgid "// with a message on the `respond_on` channel." +msgstr "" + +#: src/async/pitfalls/pin.md +#, fuzzy +msgid "// A worker which listens for work on a queue and performs it." msgstr "// A worker which listens for work on a queue and performs it.\n" #: src/async/pitfalls/pin.md -msgid "// Pretend to work.\n" +#, fuzzy +msgid "// Pretend to work." msgstr "// Pretend to work.\n" #: src/async/pitfalls/pin.md @@ -21792,11 +21985,13 @@ msgid "\"failed to send response\"" msgstr "\"failed to send response\"" #: src/async/pitfalls/pin.md -msgid "// TODO: report number of iterations every 100ms\n" +#, fuzzy +msgid "// TODO: report number of iterations every 100ms" msgstr "// TODO: report number of iterations every 100ms\n" #: src/async/pitfalls/pin.md -msgid "// A requester which requests work and waits for it to complete.\n" +#, fuzzy +msgid "// A requester which requests work and waits for it to complete." msgstr "// A requester which requests work and waits for it to complete.\n" #: src/async/pitfalls/pin.md @@ -22005,7 +22200,8 @@ msgid "" msgstr "通过将 `buf` 整合到结构体中,`LinesReader 可以确保取消操作的安全性:" #: src/async/pitfalls/cancellation.md -msgid "// prefix buf and bytes with self.\n" +#, fuzzy +msgid "// prefix buf and bytes with self." msgstr "// prefix buf and bytes with self.\n" #: src/async/pitfalls/cancellation.md @@ -22080,8 +22276,12 @@ msgstr "" "run` 不会死锁:" #: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md -msgid "// Make them think and eat\n" +msgid "// Keep trying until we have both forks" +msgstr "" + +#: src/exercises/concurrency/dining-philosophers-async.md +#, fuzzy +msgid "// Make them think and eat" msgstr "// Make them think and eat\n" #: src/exercises/concurrency/dining-philosophers-async.md @@ -22174,7 +22374,7 @@ msgid "" "[dependencies]\n" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.0.0\"\n" -"tokio = { version = \"1.28.1\", features = [\"full\"] }\n" +"tokio = { version = \"1.36.0\", features = [\"full\"] }\n" "tokio-websockets = { version = \"0.5.1\", features = [\"client\", " "\"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" @@ -22286,7 +22486,8 @@ msgid "_src/bin/server.rs_:" msgstr "`src/bin/server.rs`:" #: src/exercises/concurrency/chat-app.md -msgid "// TODO: For a hint, see the description of the task below.\n" +#, fuzzy +msgid "// TODO: For a hint, see the description of the task below." msgstr "// TODO: For a hint, see the description of the task below.\n" #: src/exercises/concurrency/chat-app.md @@ -22378,31 +22579,49 @@ msgid "([back to exercise](dining-philosophers-async.md))" msgstr "([返回练习](dining-philosophers-async.md))" #: src/exercises/concurrency/solutions-afternoon.md -msgid "" -"// Add a delay before picking the second fork to allow the execution\n" -" // to transfer to another task\n" +msgid "// Keep trying until we have both forks\n" +msgstr "" + +#: src/exercises/concurrency/solutions-afternoon.md +msgid "// Pick up forks...\n" +msgstr "// Pick up forks...\n" + +#: src/exercises/concurrency/solutions-afternoon.md +msgid "" +"// If we didn't get the left fork, drop the right fork if we\n" +" // have it and let other tasks make progress.\n" +msgstr "" + +#: src/exercises/concurrency/solutions-afternoon.md +msgid "" +"// If we didn't get the right fork, drop the left fork and let\n" +" // other tasks make progress.\n" msgstr "" -"// Add a delay before picking the second fork to allow the execution\n" -" // to transfer to another task\n" #: src/exercises/concurrency/solutions-afternoon.md msgid "// The locks are dropped here\n" msgstr "// The locks are dropped here\n" #: src/exercises/concurrency/solutions-afternoon.md -msgid "" -"// To avoid a deadlock, we have to break the symmetry\n" -" // somewhere. This will swap the forks without deinitializing\n" -" // either of them.\n" -msgstr "" -"// To avoid a deadlock, we have to break the symmetry\n" -" // somewhere. This will swap the forks without deinitializing\n" -" // either of them.\n" +msgid "// Create forks\n" +msgstr "// Create forks\n" + +#: src/exercises/concurrency/solutions-afternoon.md +msgid "// Create philosophers\n" +msgstr "// Create philosophers\n" #: src/exercises/concurrency/solutions-afternoon.md msgid "// tx is dropped here, so we don't need to explicitly drop it later\n" msgstr "// tx is dropped here, so we don't need to explicitly drop it later\n" +#: src/exercises/concurrency/solutions-afternoon.md +msgid "// Make them think and eat\n" +msgstr "// Make them think and eat\n" + +#: src/exercises/concurrency/solutions-afternoon.md +msgid "// Output their thoughts\n" +msgstr "// Output their thoughts\n" + #: src/exercises/concurrency/solutions-afternoon.md msgid "\"Here is a thought: {thought}\"" msgstr "\"Here is a thought: {thought}\"" @@ -23279,6 +23498,157 @@ msgstr "" "[CXX](https://cxx.rs/) 的图片。如需了解详情(包括许可条款), 请参阅 " "`third_party/cxx/` 目录。" +#~ msgid "" +#~ "// x = 20;\n" +#~ " // println!(\"x: {x}\");\n" +#~ msgstr "" +#~ "// x = 20;\n" +#~ " // println!(\"x: {x}\");\n" + +#~ msgid "" +#~ "// Calculate the magnitude of a vector by summing the squares of its " +#~ "coordinates\n" +#~ "// and taking the square root. Use the `sqrt()` method to calculate the " +#~ "square\n" +#~ "// root, like `v.sqrt()`.\n" +#~ msgstr "" +#~ "// Calculate the magnitude of a vector by summing the squares of its " +#~ "coordinates\n" +#~ "// and taking the square root. Use the `sqrt()` method to calculate the " +#~ "square\n" +#~ "// root, like `v.sqrt()`.\n" + +#~ msgid "" +#~ "// ANCHOR_END: Window-width\n" +#~ " // Add 4 paddings for borders\n" +#~ msgstr "" +#~ "// ANCHOR_END: Window-width\n" +#~ " // Add 4 paddings for borders\n" + +#~ msgid "" +#~ "// TODO: after learning about error handling, you can change\n" +#~ " // draw_into to return Result<(), std::fmt::Error>. Then use\n" +#~ " // the ?-operator here instead of .unwrap().\n" +#~ msgstr "" +#~ "// TODO: after learning about error handling, you can change\n" +#~ " // draw_into to return Result<(), std::fmt::Error>. Then use\n" +#~ " // the ?-operator here instead of .unwrap().\n" + +#~ msgid "" +#~ "/// Shortens a string to the given length.\n" +#~ "///\n" +#~ "/// ```\n" +#~ "/// # use playground::shorten_string;\n" +#~ "/// assert_eq!(shorten_string(\"Hello World\", 5), \"Hello\");\n" +#~ "/// assert_eq!(shorten_string(\"Hello World\", 20), \"Hello World\");\n" +#~ "/// ```\n" +#~ msgstr "" +#~ "/// Shortens a string to the given length.\n" +#~ "///\n" +#~ "/// ```\n" +#~ "/// # use playground::shorten_string;\n" +#~ "/// assert_eq!(shorten_string(\"Hello World\", 5), \"Hello\");\n" +#~ "/// assert_eq!(shorten_string(\"Hello World\", 20), \"Hello World\");\n" +#~ "/// ```\n" + +#~ msgid "" +#~ "// Safe because r1 and r2 were obtained from references and so are\n" +#~ " // guaranteed to be non-null and properly aligned, the objects " +#~ "underlying\n" +#~ " // the references from which they were obtained are live throughout " +#~ "the\n" +#~ " // whole unsafe block, and they are not accessed either through the\n" +#~ " // references or concurrently through any other pointers.\n" +#~ msgstr "" +#~ "// Safe because r1 and r2 were obtained from references and so are\n" +#~ " // guaranteed to be non-null and properly aligned, the objects " +#~ "underlying\n" +#~ " // the references from which they were obtained are live throughout " +#~ "the\n" +#~ " // whole unsafe block, and they are not accessed either through the\n" +#~ " // references or concurrently through any other pointers.\n" + +#~ msgid "" +#~ "// NOT SAFE. DO NOT DO THIS.\n" +#~ " /*\n" +#~ " let r3: &String = unsafe { &*r1 };\n" +#~ " drop(s);\n" +#~ " println!(\"r3 is: {}\", *r3);\n" +#~ " */" +#~ msgstr "" +#~ "// NOT SAFE. DO NOT DO THIS.\n" +#~ " /*\n" +#~ " let r3: &String = unsafe { &*r1 };\n" +#~ " drop(s);\n" +#~ " println!(\"r3 is: {}\", *r3);\n" +#~ " */" + +#, fuzzy +#~ msgid "" +#~ "// Not upholding the UTF-8 encoding requirement breaks memory safety!\n" +#~ " // println!(\"emoji: {}\", unsafe { emojis.get_unchecked(0..3) });\n" +#~ " // println!(\"char count: {}\", count_chars(unsafe {\n" +#~ " // emojis.get_unchecked(0..3) }));\n" +#~ msgstr "" +#~ "// Not upholding the UTF-8 encoding requirement breaks memory safety!\n" +#~ " // println!(\"emoji: {}\", unsafe { emojis.get_unchecked(0..3) });\n" +#~ " // println!(\"char count: {}\", count_chars(unsafe { emojis." +#~ "get_unchecked(0..3) }));\n" + +#~ msgid "" +#~ "/// Swaps the values pointed to by the given pointers.\n" +#~ "///\n" +#~ "/// # Safety\n" +#~ "///\n" +#~ "/// The pointers must be valid and properly aligned.\n" +#~ msgstr "" +#~ "/// Swaps the values pointed to by the given pointers.\n" +#~ "///\n" +#~ "/// # Safety\n" +#~ "///\n" +#~ "/// The pointers must be valid and properly aligned.\n" + +#~ msgid "" +#~ "// Set up the I2C controller and Inertial Measurement Unit.\n" +#~ " // TODO\n" +#~ msgstr "" +#~ "// Set up the I2C controller and Inertial Measurement Unit.\n" +#~ " // TODO\n" + +#~ msgid "" +#~ "// Read compass data and log it to the serial port.\n" +#~ " // TODO\n" +#~ msgstr "" +#~ "// Read compass data and log it to the serial port.\n" +#~ " // TODO\n" + +#~ msgid "" +#~ "// left_fork: ...\n" +#~ " // right_fork: ...\n" +#~ " // thoughts: ...\n" +#~ msgstr "" +#~ "// left_fork: ...\n" +#~ " // right_fork: ...\n" +#~ " // thoughts: ...\n" + +#~ msgid "" +#~ "// Add a delay before picking the second fork to allow the execution\n" +#~ " // to transfer to another task\n" +#~ msgstr "" +#~ "// Add a delay before picking the second fork to allow the execution\n" +#~ " // to transfer to another task\n" + +#~ msgid "" +#~ "// To avoid a deadlock, we have to break the symmetry\n" +#~ " // somewhere. This will swap the forks without " +#~ "deinitializing\n" +#~ " // either of them.\n" +#~ msgstr "" +#~ "// To avoid a deadlock, we have to break the symmetry\n" +#~ " // somewhere. This will swap the forks without " +#~ "deinitializing\n" +#~ " // either of them.\n" + #, fuzzy #~ msgid "Exercise: GUI Library" #~ msgstr "练习:面向 GUI 库的模块" @@ -23332,9 +23702,6 @@ msgstr "" #~ "将以下代码复制到 ,然后填入缺少" #~ "的“draw_into”方法,以便实现“Widget”trait:" -#~ msgid "// TODO: Implement `Widget` for `Label`.\n" -#~ msgstr "// TODO: Implement `Widget` for `Label`.\n" - #~ msgid "// TODO: Implement `Widget` for `Button`.\n" #~ msgstr "// TODO: Implement `Widget` for `Button`.\n"