Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

vohoanglong0107
Copy link
Contributor

A small one. The final PR for Std Trait session will include the Default and Closures chapter, along with the session's exercises.

Copy link
Collaborator

@daivinhtran daivinhtran left a 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: {}\""
Copy link
Collaborator

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"

Copy link
Contributor Author

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: {}\""
Copy link
Collaborator

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"

Copy link
Contributor Author

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 "
Copy link
Collaborator

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"?

Copy link
Contributor Author

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?

@mgeisler mgeisler changed the title Translate Casting and Read/Write chapters from Std Trait session vi: Translate Casting and Read/Write chapters from Std Trait session May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants