mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-01-19 04:48:12 +02:00
ko: refresh translation for enums (#930)
* ko: refresh translation for enums Part of #925. * Apply suggestions from code review Co-authored-by: Jiyong Park <55639800+jiyongp@users.noreply.github.com> --------- Co-authored-by: Jiyong Park <55639800+jiyongp@users.noreply.github.com>
This commit is contained in:
parent
9d99e9b082
commit
80823a6f2b
80
po/ko.po
80
po/ko.po
@ -4979,6 +4979,32 @@ msgid ""
|
||||
"}\n"
|
||||
"```"
|
||||
msgstr ""
|
||||
"```rust,editable\n"
|
||||
"enum WebEvent {\n"
|
||||
" PageLoad, // 페이로드가 없는 유형\n"
|
||||
" KeyPress(char), // 튜플 구조체 유형\n"
|
||||
" Click { x: i64, y: i64 }, // 완전한 구조체 유형\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"#[rustfmt::skip]\n"
|
||||
"fn inspect(event: WebEvent) {\n"
|
||||
" match event {\n"
|
||||
" WebEvent::PageLoad => println!(\"page loaded\"),\n"
|
||||
" WebEvent::KeyPress(c) => println!(\"pressed '{c}'\"),\n"
|
||||
" WebEvent::Click { x, y } => println!(\"clicked at x={x}, y={y}\"),\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"fn main() {\n"
|
||||
" let load = WebEvent::PageLoad;\n"
|
||||
" let press = WebEvent::KeyPress('x');\n"
|
||||
" let click = WebEvent::Click { x: 20, y: 80 };\n"
|
||||
"\n"
|
||||
" inspect(load);\n"
|
||||
" inspect(press);\n"
|
||||
" inspect(click);\n"
|
||||
"}\n"
|
||||
"```"
|
||||
|
||||
#: src/enums/variant-payloads.md:35
|
||||
msgid ""
|
||||
@ -13374,3 +13400,57 @@ msgid ""
|
||||
"}\n"
|
||||
"```"
|
||||
msgstr ""
|
||||
|
||||
#: src/enums.md:6
|
||||
msgid ""
|
||||
"```rust,editable\n"
|
||||
"fn generate_random_number() -> i32 {\n"
|
||||
" // Implementation based on https://xkcd.com/221/\n"
|
||||
" 4 // Chosen by fair dice roll. Guaranteed to be random.\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"#[derive(Debug)]\n"
|
||||
"enum CoinFlip {\n"
|
||||
" Heads,\n"
|
||||
" Tails,\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"fn flip_coin() -> CoinFlip {\n"
|
||||
" let random_number = generate_random_number();\n"
|
||||
" if random_number % 2 == 0 {\n"
|
||||
" return CoinFlip::Heads;\n"
|
||||
" } else {\n"
|
||||
" return CoinFlip::Tails;\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"fn main() {\n"
|
||||
" println!(\"You got: {:?}\", flip_coin());\n"
|
||||
"}\n"
|
||||
"```"
|
||||
msgstr ""
|
||||
"```rust,editable\n"
|
||||
"fn generate_random_number() -> i32 {\n"
|
||||
" // Implementation based on https://xkcd.com/221/\n"
|
||||
" 4 // Chosen by fair dice roll. Guaranteed to be random.\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"#[derive(Debug)]\n"
|
||||
"enum CoinFlip {\n"
|
||||
" Heads,\n"
|
||||
" Tails,\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"fn flip_coin() -> CoinFlip {\n"
|
||||
" let random_number = generate_random_number();\n"
|
||||
" if random_number % 2 == 0 {\n"
|
||||
" return CoinFlip::Heads;\n"
|
||||
" } else {\n"
|
||||
" return CoinFlip::Tails;\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"fn main() {\n"
|
||||
" println!(\"You got: {:?}\", flip_coin());\n"
|
||||
"}\n"
|
||||
"```"
|
||||
|
Loading…
x
Reference in New Issue
Block a user