🌐 [translation-sync] Add Type Hints section to More Language Features lecture#69
🌐 [translation-sync] Add Type Hints section to More Language Features lecture#69
Conversation
✅ Deploy Preview for majestic-griffin-10b166 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
| Criterion | Score |
|---|---|
| Accuracy | 9/10 |
| Fluency | 9/10 |
| Terminology | 8/10 |
| Formatting | 7/10 |
| Overall | 8.5/10 |
Summary: The translation of the modified and added sections is generally of high quality with natural Persian phrasing and accurate technical content. However, there is a critical structural issue: the frontmatter/preamble content (the anchor label, raw jupyter div, and main heading) is duplicated, which will cause rendering errors. Additionally, 'type hints' is omitted from the Overview's topic list. The translation choice of 'سرنخهای نوع' for 'type hints' is understandable but slightly unidiomatic. The Persian numeral usage in the for-loop iterator description section is inconsistent with the rest of the document. These issues should be addressed before merging. The newly added 'Type hints' section and all its subsections are translated accurately and fluently, with clear Persian explanations of concepts like dynamic typing, runtime non-enforcement, and tooling benefits. The heading-map in the YAML frontmatter is comprehensive and correctly maps all new and modified sections including the entire Type hints hierarchy. Technical terminology for decorators, descriptors, generators, and iterators is handled consistently throughout the modified sections, with appropriate use of transliterated terms where no standard Persian equivalent exists. The * and ** operators section is translated with good clarity, correctly distinguishing between positional and keyword argument unpacking in both Persian and technical contexts. Mathematical and code content is fully preserved with no alterations to LaTeX, code cells, or MyST directives in the modified sections.
⚠️ Markdown Syntax Errors (CRITICAL)
- 🔴 Duplicate content: The preamble/frontmatter contains duplicate sections - both the (python_advanced_features)= label and the raw jupyter div/header block appear twice, followed by two identical '# ویژگیهای بیشتر زبان' headings. This is a critical structural error.
- 🔴 Overview section: The translation omits 'type hints' from the list of topics ('موضوعات متنوعی در این سخنرانی بررسی میشوند، از جمله iteratorها، decoratorها و descriptorها، و generatorها') - 'type hints' is missing from the Persian enumeration whereas the English source explicitly lists it.
Suggestions:
- Preamble/Frontmatter: The document contains duplicated header content — the
(python_advanced_features)=anchor, the{raw} jupyterdiv, and the# ویژگیهای بیشتر زبانheading all appear twice. This must be de-duplicated to avoid rendering errors. - Overview section: 'A variety of topics are treated in the lecture, including iterators, type hints, decorators and descriptors, and generators.' → The Persian translation omits 'type hints' (سرنخهای نوع): 'موضوعات متنوعی در این سخنرانی بررسی میشوند، از جمله iteratorها، سرنخهای نوع، decoratorها و descriptorها، و generatorها.'
- Type hints section: 'Type hints' is translated as 'سرنخهای نوع' throughout, but a more established and natural Persian term would be 'راهنماهای نوع' or 'اعلان نوع'. The chosen term 'سرنخ' (clue/hint) is technically correct but less idiomatic in a programming context. Consider 'اعلان نوع' or 'حاشیهنویسی نوع' for consistency with common Persian programming terminology.
- Iterators in for loops section: The English uses numbered list markers '1.' and '2.' but the Persian translation switches to Persian numerals '۱.' and '۱.' for the inline numbered list describing what the interpreter does. This is inconsistent with the rest of the document and may cause MyST rendering issues — the second item also appears to reuse '۱.' instead of '۲.'
- Type hints::Why use type hints? section: 'LLM-generated code: Large language models frequently produce code with type hints' → translated as 'کد تولیدشده توسط مدلهای زبانی بزرگ: مدلهای زبانی بزرگ اغلب کدی با سرنخهای نوع تولید میکنند'. The heading label 'LLM-generated code' is fully expanded but the abbreviation 'LLM' itself is not mentioned. Consider: 'کد تولیدشده توسط مدلهای زبانی بزرگ (LLM)' to preserve the technical abbreviation for readers.
🔍 Diff Quality
| Check | Status |
|---|---|
| Scope Correct | ✅ |
| Position Correct | ❌ |
| Structure Preserved | ❌ |
| Heading-map Correct | ✅ |
| Overall | 5/10 |
Summary: The heading-map is correctly updated and the new Type hints section is translated and inserted at the right position, but the target document has a critical structural defect — the document preamble (anchor, raw header div, H1 title) is duplicated, and the overview paragraph was not updated to mention type hints.
Issues:
- The target document 'After' contains a duplicate header block: the
(python_advanced_features)=anchor, the raw jupyter div, and# ویژگیهای بیشتر زبانheading appear twice at the top of the document body. - The source 'After' removed the header raw block entirely (it was present in source 'Before'), but the target 'After' kept it and duplicated it, resulting in two occurrences of the notebook header div and the H1 heading.
- The translated content for the new 'Type hints' section appears to be correctly added, but its placement is disrupted by the duplicate header block above it, breaking the document flow.
- The overview paragraph in the target 'After' still says 'iteratorها، decoratorها و descriptorها، و generatorها' but the source 'After' added 'type hints' to this list — the translated overview paragraph was not updated to include type hints.
- The source 'After' changed heading capitalisation (e.g. 'Iterables and Iterators' → 'Iterables and iterators', 'For Loops' → 'for loops', etc.); the heading-map keys are correctly updated, but the actual translated section headings in the body sometimes still use the old capitalisation style inconsistently.
This review was generated automatically by action-translation review mode.
Automated Translation Sync
This PR contains automated translations from QuantEcon/lecture-python-programming.
Source PR
#488 - Add Type Hints section to More Language Features lecture
Files Updated
lectures/python_advanced_features.md.translate/state/python_advanced_features.md.ymlDetails
This PR was created automatically by the translation action.