1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-04-15 21:28:43 +02:00

vi: translate Default trait (#2447)

Translate the `Default` chapter of the `std-trait` section to Vietnamese
This commit is contained in:
Võ Hoàng Long 2024-10-28 02:32:59 +08:45 committed by GitHub
parent 8bfff0d95a
commit 8873e3ea53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6911,65 +6911,76 @@ msgstr "\"Dữ liệu đã được ghi: {:?}\""
#: src/std-traits/default.md #: src/std-traits/default.md
msgid "The `Default` Trait" msgid "The `Default` Trait"
msgstr "" msgstr "Trait `Default`"
#: src/std-traits/default.md #: src/std-traits/default.md
msgid "" msgid ""
"[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) trait " "[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) trait "
"produces a default value for a type." "produces a default value for a type."
msgstr "" msgstr ""
"Kiểu dữ liệu implement trait [`Default`](https://doc.rust-lang.org/std/"
"default/trait.Default.html) sẽ sở hữu một giá trị mặc định."
#: src/std-traits/default.md #: src/std-traits/default.md
msgid "\"John Smith\"" msgid "\"John Smith\""
msgstr "" msgstr "\"John Smith\""
#: src/std-traits/default.md #: src/std-traits/default.md
msgid "\"{default_struct:#?}\"" msgid "\"{default_struct:#?}\""
msgstr "" msgstr "\"{default_struct:#?}\""
#: src/std-traits/default.md #: src/std-traits/default.md
msgid "\"Y is set!\"" msgid "\"Y is set!\""
msgstr "" msgstr "\"Biến Y đã được gán!\""
#: src/std-traits/default.md #: src/std-traits/default.md
msgid "\"{almost_default_struct:#?}\"" msgid "\"{almost_default_struct:#?}\""
msgstr "" msgstr "\"{almost_default_struct:#?}\""
#: src/std-traits/default.md src/lifetimes/exercise.md #: src/std-traits/default.md src/lifetimes/exercise.md
#: src/lifetimes/solution.md #: src/lifetimes/solution.md
msgid "\"{:#?}\"" msgid "\"{:#?}\""
msgstr "" msgstr "\"{:#?}\""
#: src/std-traits/default.md #: src/std-traits/default.md
msgid "" msgid ""
"It can be implemented directly or it can be derived via `#[derive(Default)]`." "It can be implemented directly or it can be derived via `#[derive(Default)]`."
msgstr "" msgstr ""
"Người dùng có thể trực tiếp implement trait này, hoặc derive trait này bằng "
"`#[derive(Default)]`."
#: src/std-traits/default.md #: src/std-traits/default.md
msgid "" msgid ""
"A derived implementation will produce a value where all fields are set to " "A derived implementation will produce a value where all fields are set to "
"their default values." "their default values."
msgstr "" msgstr ""
"Khi derive trait này, từng miền của giá trị mặc định được tạo ra sẽ được gán "
"bằng giá trị mặc định của kiểu dữ liệu tương ứng."
#: src/std-traits/default.md #: src/std-traits/default.md
msgid "This means all types in the struct must implement `Default` too." msgid "This means all types in the struct must implement `Default` too."
msgstr "" msgstr "Vì vậy tất cả các miền của struct cũng phải implement `Default`."
#: src/std-traits/default.md #: src/std-traits/default.md
msgid "" msgid ""
"Standard Rust types often implement `Default` with reasonable values (e.g. " "Standard Rust types often implement `Default` with reasonable values (e.g. "
"`0`, `\"\"`, etc)." "`0`, `\"\"`, etc)."
msgstr "" msgstr ""
"Kiểu dữ liệu chuẩn của Rust thường hay implement trait `Default` (như `0`, "
"`\"\"`, vân vân)."
#: src/std-traits/default.md #: src/std-traits/default.md
msgid "The partial struct initialization works nicely with default." msgid "The partial struct initialization works nicely with default."
msgstr "" msgstr "Trait này rất hữu dụng khi ta cần khởi tạo struct chỉ với một ít miền."
#: src/std-traits/default.md #: src/std-traits/default.md
msgid "" msgid ""
"The Rust standard library is aware that types can implement `Default` and " "The Rust standard library is aware that types can implement `Default` and "
"provides convenience methods that use it." "provides convenience methods that use it."
msgstr "" msgstr ""
"Vì các kiểu dữ liệu thường hay implment `Default`, thư viện chuẩn của Rust "
"cũng cung cấp một số hàm giúp người dùng có thể tận dụng giá trị mặc định "
"của biến."
#: src/std-traits/default.md #: src/std-traits/default.md
msgid "" msgid ""
@ -6977,6 +6988,9 @@ msgid ""
"book/ch05-01-defining-structs.html#creating-instances-from-other-instances-" "book/ch05-01-defining-structs.html#creating-instances-from-other-instances-"
"with-struct-update-syntax)." "with-struct-update-syntax)."
msgstr "" msgstr ""
"Dấu `..` còn được gọi là [ký hiệu update struct](https://doc.rust-lang.org/"
"book/ch05-01-defining-structs.html#creating-instances-from-other-instances-"
"with-struct-update-syntax)."
#: src/std-traits/closures.md #: src/std-traits/closures.md
msgid "" msgid ""