mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-03-05 16:36:19 +02:00
zh-CN: Add translation for pattern-matching.md (#821)
* [zh-CN] Add translation for pattern-matching.md * Update po/zh-CN.po Co-authored-by: wnghl <wnghilin@gmail.com> --------- Co-authored-by: wnghl <wnghilin@gmail.com>
This commit is contained in:
parent
b2ebd8848c
commit
78a7f19e34
17
po/zh-CN.po
17
po/zh-CN.po
@ -284,7 +284,7 @@ msgstr ""
|
||||
|
||||
#: src/SUMMARY.md:85
|
||||
msgid "Pattern Matching"
|
||||
msgstr ""
|
||||
msgstr "模式匹配"
|
||||
|
||||
#: src/SUMMARY.md:86
|
||||
msgid "Destructuring Enums"
|
||||
@ -5799,18 +5799,18 @@ msgstr ""
|
||||
|
||||
#: src/pattern-matching.md:1
|
||||
msgid "# Pattern Matching"
|
||||
msgstr ""
|
||||
msgstr "# 模式匹配"
|
||||
|
||||
#: src/pattern-matching.md:3
|
||||
msgid ""
|
||||
"The `match` keyword let you match a value against one or more _patterns_. "
|
||||
"The\n"
|
||||
"comparisons are done from top to bottom and the first match wins."
|
||||
msgstr ""
|
||||
msgstr "使用关键词 `match` 对一个值进行模式匹配。进行匹配时,会从上至下依次进行比较,并选定第一个匹配成功的结果。"
|
||||
|
||||
#: src/pattern-matching.md:6
|
||||
msgid "The patterns can be simple values, similarly to `switch` in C and C++:"
|
||||
msgstr ""
|
||||
msgstr "模式 (pattern) 可以是简单的值,其用法类似于 C 与 C++ 中的 `switch` 。"
|
||||
|
||||
#: src/pattern-matching.md:8
|
||||
msgid ""
|
||||
@ -5830,7 +5830,7 @@ msgstr ""
|
||||
|
||||
#: src/pattern-matching.md:21
|
||||
msgid "The `_` pattern is a wildcard pattern which matches any value."
|
||||
msgstr ""
|
||||
msgstr "模式 `_` 是外卡 (wildcard) 模式。它可以匹配任何值。"
|
||||
|
||||
#: src/pattern-matching.md:26
|
||||
msgid ""
|
||||
@ -5847,6 +5847,13 @@ msgid ""
|
||||
"as the term can show up in error messages.\n"
|
||||
" "
|
||||
msgstr ""
|
||||
"* 你可以解释一些用于表达模式的特殊字符的用法\n"
|
||||
" *`|` 表示或 (or)\n"
|
||||
" *`..` 可以展开为任意一个或多个值\n"
|
||||
" *`1..=5` 代表了一个闭区间范围\n"
|
||||
"* 解释模式匹配中的绑定的原理可能会很有帮助。比如可以用一个变量替代外卡,或者去除 `q` 外面的引号。\n"
|
||||
"* 你可以展示如何匹配一个引用。\n"
|
||||
"* 现在是一个讲解不可反驳 (irrefutable) 模式的好时机。因为这个术语可能会出现在错误信息中。"
|
||||
|
||||
#: src/pattern-matching/destructuring-enums.md:1
|
||||
msgid "# Destructuring Enums"
|
||||
|
Loading…
x
Reference in New Issue
Block a user