Skip to content

translate tutorial/datastructures.po - #37

Merged
tamnd merged 11 commits into
mainfrom
translate/tutorial-datastructures
Apr 23, 2026
Merged

tamnd merged 11 commits into
mainfrom
translate/tutorial-datastructures

Conversation

@tamnd

@tamnd tamnd commented Apr 23, 2026

Copy link
Copy Markdown
Owner

Warning

Machine translation. All entries in this PR were produced by automated translation and are marked fuzzy. Please verify each one against the English source before removing the flag.

Translates tutorial/datastructures.po (126 entries). Base pulled from tamnd/python-docs-vi after the Transifex run on 2026-04-23.

Commits follow the chapter structure so it is easier to review section by section:

  • intro and list methods (append, extend, insert, remove, pop, clear, index, count, sort, reverse, copy)
  • using lists as stacks and queues
  • list comprehensions
  • nested list comprehensions
  • the del statement and tuples
  • sets and dictionaries
  • looping techniques
  • conditions and sequence comparisons

tamnd added 9 commits April 23, 2026 17:08
Cover the chapter intro and the full list of list methods:
append, extend, insert, remove, pop, clear, index, count, sort, reverse, copy.
Stack (LIFO) and queue (FIFO) usage with lists and collections.deque.
List comprehension syntax, nested loops inside comprehensions,
and equivalent for-loop forms.
Nested comprehensions, matrix transposition example,
and zip() as the idiomatic alternative.
The del statement for index- and variable-level deletion,
plus tuple packing and sequence unpacking.
Sets (unordered, no duplicates, set comprehensions)
and dictionaries (key-value pairs, dict(), dict comprehensions).
items(), enumerate(), zip(), reversed(), sorted(), set() idioms
for looping and filtering sequences.
Boolean operators (and/or/not), short-circuit evaluation,
and lexicographic comparison of sequences.
@tamnd
tamnd force-pushed the translate/tutorial-datastructures branch from cdbeb70 to 2684c3d Compare April 23, 2026 10:08

@tamnd tamnd left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the full file as a professional Python + Vietnamese translator against GLOSSARY.md. Summary of issues found, from most critical to minor:

Critical — code without >>> prefix was translated as prose. Two plain-code msgids were treated as text and fully translated. These must be identical to their msgid.

Systematic — GLOSSARY terms not applied. Several terms that GLOSSARY.md says to keep in English were translated: list, tuple, set, dict, comprehension, method. And "raises" was rendered as "tăng" (increases) instead of "Gây ra".

Semantic error. "squares" (bình phương, as in x²) was translated as "hình vuông" (geometric square shape) throughout.

Wrong register. "khả năng hiểu chính tả" for "dict comprehensions" is a completely garbled translation — "chính tả" means "spelling/orthography".

Inline comments below point to the exact lines.

"raises a :exc:`ValueError` if there is no such item."
msgstr ""
"Xóa mục đầu tiên khỏi danh sách có giá trị bằng *value*. Nó tăng "
":exc:`ValueError` nếu không có phần tử đó."

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Nó tăng" không đúng cho "raises". Theo GLOSSARY nên dùng "Gây ra :exc:`ValueError`".

"Xóa mục ở vị trí nhất định trong danh sách và trả lại. Nếu không có chỉ mục"
" nào được chỉ định, ``a.pop()`` sẽ xóa và trả về mục cuối cùng trong danh "
"sách. Nó tăng :exc:`IndexError` nếu danh sách trống hoặc chỉ mục nằm ngoài "
"phạm vi danh sách."

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Nó tăng :exc:`IndexError`" → "Gây ra :exc:`IndexError`". Chỗ này cũng thiếu dấu chấm cuối câu so với bản gốc.

"Raises a :exc:`ValueError` if there is no such item."
msgstr ""
"Trả về chỉ mục dựa trên 0 của lần xuất hiện đầu tiên của *value* trong danh "
"sách. Tăng :exc:`ValueError` nếu không có phần tử đó."

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Tăng :exc:`ValueError`" → "Gây ra :exc:`ValueError`".

#, fuzzy
msgid "Return a shallow copy of the list. Similar to ``a[:]``."
msgstr ""
msgstr "Trả lại một bản sao nông của danh sách. Tương tự với ``a[:]``"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Trả lại" nghe không tự nhiên lắm, nên dùng "Trả về". Cũng thiếu dấu chấm cuối.

#, fuzzy
msgid "List Comprehensions"
msgstr ""
msgstr "Danh sách hiểu"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"List Comprehensions" dịch thành "Danh sách hiểu" không đúng. GLOSSARY quy định "comprehension" giữ tiếng Anh. Nên để "List comprehension" hoặc "Comprehension danh sách".

#, fuzzy
msgid "For example, assume we want to create a list of squares, like::"
msgstr ""
msgstr "Ví dụ: giả sử chúng ta muốn tạo một danh sách các hình vuông, như::"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"hình vuông" ở đây có nghĩa là bình phương (x^2), không phải hình học. Dùng "bình phương" cho đúng nghĩa.

#, fuzzy
msgid "squares = list(map(lambda x: x**2, range(10)))"
msgstr ""
msgstr "hình vuông = danh sách(map(lambda x: x**2, range(10)))"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code bị dịch sang tiếng Việt rồi. Dòng này phải giữ nguyên y hệt msgid: squares = list(map(lambda x: x**2, range(10)))

#, fuzzy
msgid "squares = [x**2 for x in range(10)]"
msgstr ""
msgstr "hình vuông = [x**2 cho x trong phạm vi (10)]"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code bị dịch sang tiếng Việt rồi. Dòng này phải giữ nguyên y hệt msgid: squares = [x**2 for x in range(10)]

":keyword:`!if` clauses which follow it. For example, this listcomp combines "
"the elements of two lists if they are not equal::"
msgstr ""
"Việc hiểu danh sách bao gồm các dấu ngoặc chứa một biểu thức theo sau là "

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Việc hiểu danh sách" nên là "List comprehension" theo GLOSSARY. Cả đoạn này dùng "comprehension" nhất quán thôi.

">>> freshfruit = [' banana', ' loganberry ', 'passion fruit ']\n"
">>> [weapon.strip() for weapon in freshfruit]\n"
"['banana', 'loganberry', 'passion fruit']\n"
">>> # tạo danh sách gồm 2 bộ dữ liệu như (số, hình vuông)\n"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment trong code: "hình vuông" nên là "bình phương". Đây là số bình phương (x^2), không phải hình vuông.

#, fuzzy
msgid "Nested List Comprehensions"
msgstr ""
msgstr "Hiểu danh sách lồng nhau"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Hiểu danh sách lồng nhau" nên là "List comprehension lồng nhau" theo GLOSSARY.

#, fuzzy
msgid "The :keyword:`!del` statement"
msgstr ""
msgstr "Tuyên bố :keyword:`!del`"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Tuyên bố" không đúng nghĩa cho "statement". Nên dùng "Câu lệnh :keyword:!del".

#, fuzzy
msgid "Tuples and Sequences"
msgstr ""
msgstr "Bộ dữ liệu và trình tự"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Bộ dữ liệu và trình tự" không đúng. GLOSSARY: "tuple" giữ tiếng Anh. Nên là "Tuples và Sequences".

#, fuzzy
msgid "Sets"
msgstr ""
msgstr "bộ"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiêu đề "bộ" sai hoàn toàn. "Sets" phải giữ tiếng Anh theo GLOSSARY, và chữ hoa đầu câu.

"Similarly to :ref:`list comprehensions <tut-listcomps>`, set comprehensions "
"are also supported::"
msgstr ""
"Tương tự như :ref:`list comprehensions <tut-listcomps>`, việc hiểu tập hợp "

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"việc hiểu tập hợp" nên là "set comprehension" theo GLOSSARY (comprehension giữ tiếng Anh).

"In addition, dict comprehensions can be used to create dictionaries from "
"arbitrary key and value expressions::"
msgstr ""
"Ngoài ra, khả năng hiểu chính tả có thể được sử dụng để tạo từ điển từ các "

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"khả năng hiểu chính tả" là dịch sai hoàn toàn. "dict comprehension" phải giữ nguyên tiếng Anh theo GLOSSARY.

"retrieved at the same time using the :meth:`~dict.items` method. ::"
msgstr ""
"Khi lặp qua từ điển, khóa và giá trị tương ứng có thể được truy xuất cùng "
"lúc bằng phương pháp :meth:`~dict.items`. ::"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"phương pháp" sai nghĩa. method dịch là "phương thức", không phải "phương pháp".

"paired with the :func:`zip` function. ::"
msgstr ""
"Để lặp qua hai hoặc nhiều chuỗi cùng lúc, các mục có thể được ghép nối với "
"chức năng :func:`zip`. ::"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"chức năng :func:zip" nên là "hàm :func:zip". GLOSSARY: function = hàm.

#, fuzzy
msgid "More on Conditions"
msgstr ""
msgstr "Thông tin thêm về Điều kiện"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiêu đề không nhất quán: "Điều kiện" viết hoa không cần thiết. Theo quy tắc sentence case của GLOSSARY thì phải là "Thêm về điều kiện".

#, fuzzy
msgid "Comparing Sequences and Other Types"
msgstr ""
msgstr "So sánh trình tự và các loại khác"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"trình tự" nên giữ là "sequence" theo GLOSSARY. "các loại" nên là "các kiểu" (type = kiểu dữ liệu). Sửa thành "So sánh sequence và các kiểu khác".

"(1, 2, 3) == (1.0, 2.0, 3.0)\n"
"(1, 2, ('aa', 'ab')) < (1, 2, ('abc', 'a'), 4)"
msgstr ""
"(1, 2, 3) < (1, 2, 4)\n"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Định dạng căn lề ở bảng so sánh bị mất. Bản gốc có khoảng trắng để căn thẳng cột, msgstr xóa hết rồi. Cần giữ nguyên.

@tamnd
tamnd merged commit 33088e7 into main Apr 23, 2026
@tamnd
tamnd deleted the translate/tutorial-datastructures branch April 23, 2026 10:46
tamnd added a commit that referenced this pull request Aug 18, 2026
The 29 tier 1 entries that stopped being passthrough when the identifier rule
narrowed were English headings, so they went into the queue as untranslated and
this is the run that answered them. 27 calls over server2 and server3 in 0.3h
at 91.7 calls per hour, 414 entries accepted, 26 refused and 6 out of rungs.

Tier 1 untranslated goes 31 to 4. The 4 are the entries that ran out of rungs
there, and A04 names them rather than leaving them silent.

The same run cleared batches left queued from earlier sessions in tiers 2 to 6,
which is why machine goes 737 to 867 across the corpus and not only in tier 1.

L07 goes 687 to 816 because the fleet answered 129 more batches on
gpt-5-6-mini, which is issue #37 on the translator repo and not a change here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant