From c948186fc671d8b595566ee45070db497b34a59d Mon Sep 17 00:00:00 2001 From: Yulin Shen Date: Wed, 14 Jun 2023 08:56:21 +0800 Subject: [PATCH] zh-CN: Translate for src/exercises/day-2/health-statistics.md (#807) --- po/zh-CN.po | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 2 deletions(-) diff --git a/po/zh-CN.po b/po/zh-CN.po index 3a182ccc..76bb25f6 100644 --- a/po/zh-CN.po +++ b/po/zh-CN.po @@ -304,7 +304,7 @@ msgstr "" #: src/SUMMARY.md:91 msgid "Health Statistics" -msgstr "" +msgstr "健康统计" #: src/SUMMARY.md:92 msgid "Points and Polygons" @@ -5995,7 +5995,7 @@ msgstr "" #: src/exercises/day-2/health-statistics.md:1 msgid "# Health Statistics" -msgstr "" +msgstr "# 健康统计" #: src/exercises/day-2/health-statistics.md:3 msgid "" @@ -6003,6 +6003,7 @@ msgid "" "you\n" "need to keep track of users' health statistics." msgstr "" +"你正在实现一个健康监控系统。作为其中的一部分,你需要对用户的健康统计数据进行追踪。" #: src/exercises/day-2/health-statistics.md:6 msgid "" @@ -6011,6 +6012,7 @@ msgid "" "struct definition. Your goal is to implement the stubbed out methods on the\n" "`User` `struct` defined in the `impl` block." msgstr "" +"`User` 结构体的定义和 `impl` 块中一些函数的框架已经给出。你的目标是实现在 `impl` 块中定义的 `User` `struct` 的方法。" #: src/exercises/day-2/health-statistics.md:10 msgid "" @@ -6018,6 +6020,7 @@ msgid "" "missing\n" "methods:" msgstr "" +"将以下代码复制到 ,并填充缺失的方法:" #: src/exercises/day-2/health-statistics.md:13 msgid "" @@ -6077,6 +6080,61 @@ msgid "" "}\n" "```" msgstr "" +"```rust,should_panic\n" +"// TODO: 实现完成后删除此行。\n" +"#![allow(unused_variables, dead_code)]\n" +"\n" +"struct User {\n" +" name: String,\n" +" age: u32,\n" +" weight: f32,\n" +"}\n" +"\n" +"impl User {\n" +" pub fn new(name: String, age: u32, weight: f32) -> Self {\n" +" unimplemented!()\n" +" }\n" +"\n" +" pub fn name(&self) -> &str {\n" +" unimplemented!()\n" +" }\n" +"\n" +" pub fn age(&self) -> u32 {\n" +" unimplemented!()\n" +" }\n" +"\n" +" pub fn weight(&self) -> f32 {\n" +" unimplemented!()\n" +" }\n" +"\n" +" pub fn set_age(&mut self, new_age: u32) {\n" +" unimplemented!()\n" +" }\n" +"\n" +" pub fn set_weight(&mut self, new_weight: f32) {\n" +" unimplemented!()\n" +" }\n" +"}\n" +"\n" +"fn main() {\n" +" let bob = User::new(String::from(\"Bob\"), 32, 155.2);\n" +" println!(\"I'm {} and my age is {}\", bob.name(), bob.age());\n" +"}\n" +"\n" +"#[test]\n" +"fn test_weight() {\n" +" let bob = User::new(String::from(\"Bob\"), 32, 155.2);\n" +" assert_eq!(bob.weight(), 155.2);\n" +"}\n" +"\n" +"#[test]\n" +"fn test_set_age() {\n" +" let mut bob = User::new(String::from(\"Bob\"), 32, 155.2);\n" +" assert_eq!(bob.age(), 32);\n" +" bob.set_age(33);\n" +" assert_eq!(bob.age(), 33);\n" +"}\n" +"```" #: src/exercises/day-2/points-polygons.md:1 msgid "# Polygon Struct"