1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-03-28 00:26:44 +02:00

vi: control-flow-basics/macros.md translations (#2111)

This commit is contained in:
Huy Vuong 2024-06-10 20:11:43 -06:00 committed by GitHub
parent 26e1d77b3e
commit b57319bb20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3533,38 +3533,50 @@ msgid ""
"variable number of arguments. They are distinguished by a `!` at the end. " "variable number of arguments. They are distinguished by a `!` at the end. "
"The Rust standard library includes an assortment of useful macros." "The Rust standard library includes an assortment of useful macros."
msgstr "" msgstr ""
"Macros được triển khai qua mã Rust trong quá trình biên dịch, và có thể nhận "
"nhiều những biến khác nhau. Macros được nhận diện bởi dấu `!` ở sau cùng. "
"Rust standard library (Thư viện Rust căn bản) bao gồm nhiều loại macros hữu "
"dụng khác nhau."
#: src/control-flow-basics/macros.md #: src/control-flow-basics/macros.md
msgid "" msgid ""
"`println!(format, ..)` prints a line to standard output, applying formatting " "`println!(format, ..)` prints a line to standard output, applying formatting "
"described in [`std::fmt`](https://doc.rust-lang.org/std/fmt/index.html)." "described in [`std::fmt`](https://doc.rust-lang.org/std/fmt/index.html)."
msgstr "" msgstr ""
"`println!(format, ..)` in nội dung ra standard output, áp dụng format được "
"miêu tả trong [`std::fmt`](https://doc.rust-lang.org/std/fmt/index.html)."
#: src/control-flow-basics/macros.md #: src/control-flow-basics/macros.md
msgid "" msgid ""
"`format!(format, ..)` works just like `println!` but returns the result as a " "`format!(format, ..)` works just like `println!` but returns the result as a "
"string." "string."
msgstr "" msgstr ""
"`format!(format, ..)` hoạt động tương tự như `println!` nhưng trả về dữ liệu "
"ở dạng `string`."
#: src/control-flow-basics/macros.md #: src/control-flow-basics/macros.md
msgid "`dbg!(expression)` logs the value of the expression and returns it." msgid "`dbg!(expression)` logs the value of the expression and returns it."
msgstr "" msgstr "`dbg!(expression)` logs giá trị của biểu thức rồi trả về giá trị đó."
#: src/control-flow-basics/macros.md #: src/control-flow-basics/macros.md
msgid "" msgid ""
"`todo!()` marks a bit of code as not-yet-implemented. If executed, it will " "`todo!()` marks a bit of code as not-yet-implemented. If executed, it will "
"panic." "panic."
msgstr "" msgstr ""
"`todo!()` đánh dấu một phần của mã là not-yet-implemented (chưa được hoàn "
"thiện). Khi được triển khai, đoạn mã đõ sẽ panic."
#: src/control-flow-basics/macros.md #: src/control-flow-basics/macros.md
msgid "" msgid ""
"`unreachable!()` marks a bit of code as unreachable. If executed, it will " "`unreachable!()` marks a bit of code as unreachable. If executed, it will "
"panic." "panic."
msgstr "" msgstr ""
"`unreachable!()` đánh dẫu một đoạn mã là unreachable (không thể tới). Khi "
"được triển khai, đoạn mã đõ sẽ panic."
#: src/control-flow-basics/macros.md #: src/control-flow-basics/macros.md
msgid "\"{n}! = {}\"" msgid "\"{n}! = {}\""
msgstr "" msgstr "\"{n}! = {}\""
#: src/control-flow-basics/macros.md #: src/control-flow-basics/macros.md
msgid "" msgid ""
@ -3572,12 +3584,17 @@ msgid ""
"how to use them. Why they are defined as macros, and what they expand to, is " "how to use them. Why they are defined as macros, and what they expand to, is "
"not especially critical." "not especially critical."
msgstr "" msgstr ""
"Bài học được rút ra trong chương này là những cú pháp thông dụng tiện nghi "
"trên tồn tại, và các sử dụng chúng. Tại sao chúng được định nghĩa là macros, "
"với cách những macros triền khai qua đều không quan trọng."
#: src/control-flow-basics/macros.md #: src/control-flow-basics/macros.md
msgid "" msgid ""
"The course does not cover defining macros, but a later section will describe " "The course does not cover defining macros, but a later section will describe "
"use of derive macros." "use of derive macros."
msgstr "" msgstr ""
"Khóa học này sẽ không đi qua về định nghĩ macros, nhưng những chương tiếp "
"theo sẽ đề cập tới sử dụng derive macros."
#: src/control-flow-basics/exercise.md #: src/control-flow-basics/exercise.md
msgid "" msgid ""