-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vi: Translate Casting and Read/Write chapters from Std Trait session #2080
base: main
Are you sure you want to change the base?
vi: Translate Casting and Read/Write chapters from Std Trait session #2080
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fanstatic translations, @vohoanglong0107 !
I have a few minor comments. Let me know once you fix them.
|
||
#: src/std-traits/read-and-write.md | ||
msgid "\"lines in file: {}\"" | ||
msgstr "" | ||
msgstr "\"số dòng trong file: {}\"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
số dòng is the number of lines. Let's say "những dòng"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, this line is used like this in the example:
let slice: &[u8] = b"foo\nbar\nbaz\n";
println!("lines in slice: {}", count_lines(slice));
In my opinion số dòng
would make a better translation, as we are counting for lines in the example
|
||
#: src/std-traits/read-and-write.md | ||
msgid "\"lines in slice: {}\"" | ||
msgstr "" | ||
msgstr "\"số dòng trong mảng: {}\"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
số dòng is the number of lines. Let's say "những dòng"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is used like this in the example:
let file = std::fs::File::open(std::env::current_exe()?)?;
println!("lines in file: {}", count_lines(file));
I think số dòng
would be more fitting in the given context.
po/vi.po
Outdated
|
||
#: src/std-traits/casting.md | ||
msgid "This is common in casting integers to `usize` for use as an index." | ||
msgstr "" | ||
"Một trường hợp ngoại lệ là khi chuyển đổi số nguyên sang `usize` để sử dụng " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"common" isn't "ngoại lệ". should be "thông thường"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to combine this translation to the above paragraph, forming:
Đối với những trường hợp ép kiểu có
thể thất bại, nên sử dụng `TryFrom` và `TryInto` để xử lý lỗi khi ép kiểu
(khi một giá trị không hoàn toàn phù hợp với kiểu dữ liệu đích).
Một trường hợp ngoại lệ là khi chuyển đổi số nguyên sang `usize` để sử dụng
làm index trong array
Do you think this is a good idea?
bf2e23e
to
e1d3d55
Compare
A small one. The final PR for
Std Trait
session will include theDefault
andClosures
chapter, along with the session's exercises.