Skip to content

🌐 [translation-sync] Add Type Hints section to More Language Features lecture#70

Closed
mmcky wants to merge 2 commits intomainfrom
translation-sync-2026-03-24T02-30-41-pr-488
Closed

🌐 [translation-sync] Add Type Hints section to More Language Features lecture#70
mmcky wants to merge 2 commits intomainfrom
translation-sync-2026-03-24T02-30-41-pr-488

Conversation

@mmcky
Copy link
Contributor

@mmcky mmcky commented Mar 24, 2026

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.yml

Details

  • Source Language: en
  • Target Language: fa
  • Model: claude-sonnet-4-6

This PR was created automatically by the translation action.

@netlify
Copy link

netlify bot commented Mar 24, 2026

Deploy Preview for majestic-griffin-10b166 ready!

Name Link
🔨 Latest commit 630d09a
🔍 Latest deploy log https://app.netlify.com/projects/majestic-griffin-10b166/deploys/69c1f75655c1eb0008b0f101
😎 Deploy Preview https://deploy-preview-70--majestic-griffin-10b166.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link

github-actions bot commented Mar 24, 2026

❌ Translation Quality Review

Verdict: FAIL | Model: claude-sonnet-4-6 | Date: 2026-03-24


📝 Translation Quality

Criterion Score
Accuracy 5/10
Fluency 7/10
Terminology 6/10
Formatting 3/10
Overall 5.5/10

Summary: The translation has critical structural failures: the entire newly added 'Type hints' section (6 subsections) is completely absent from the document body, and the Generators section is duplicated/mislabeled due to incorrect section heading under the (paf_generators)= anchor. The heading-map also contains incorrect mappings for the Type hints section. The portions that are translated (iterators, operators, decorators) are reasonably fluent and accurate, but the missing Type hints content and structural duplication/mislabeling of Generators are severe issues that must be fixed before this translation can be considered acceptable. The translated sections that are present (Iterables and iterators, * and ** operators, Decorators and descriptors, Generators) are generally accurate and fluent in Persian Technical terms like iterator, generator, decorator, descriptor are consistently kept in English with Persian pluralization (e.g., iteratorها, generatorها) Code blocks and MyST directives are properly preserved throughout the translated content that exists Mathematical and programming concepts are explained clearly in the Persian text where content is present

⚠️ Markdown Syntax Errors (CRITICAL)

  • 🔴 Critical: The entire 'Type hints' section (## Type hints, ### Basic syntax, ### Common types, ### Hints don't enforce types, ### Why use type hints?, ### Type hints in scientific Python) is completely missing from the translation body - these were ADDED sections that must be translated
  • 🔴 Critical: The '## Generators' section appears twice in the translation - once correctly as '## Generatorها' and once incorrectly labeled as '## Decoratorها و Descriptorها' at the anchor point (paf_generators)=, which is structurally wrong
  • 🔴 Critical: The 'Decorators and descriptors' section content is duplicated in the translation - the entire section appears twice verbatim
  • 🔴 Heading-map contains incorrect mappings: 'Type hints' maps to 'Decoratorها و Descriptorها', 'Type hints::Basic syntax' maps to 'Decoratorها', 'Type hints::Common types' maps to 'Descriptorها' - these are wrong section labels

Suggestions:

  • Type hints section (ADDED, completely missing): The entire Type hints section including all 5 subsections (Basic syntax, Common types, Hints don't enforce types, Why use type hints?, Type hints in scientific Python) is absent from the translated document body. This is a critical omission of newly added content.

  • (paf_generators)= anchor section: The content under this anchor is labeled '## Decoratorها و Descriptorها' instead of '## Generatorها', causing the Generators section to appear with wrong heading and duplicating the Decorators section content instead.
  • Overview section: The source mentions 'type hints' in the list of topics ('iterators, type hints, decorators and descriptors, and generators') but the translation omits 'type hints' - the Persian translation reads 'iteratorها، decoratorها و descriptorها، و generatorها' missing the type hints mention.

  • Heading-map in frontmatter: 'Type hints' is incorrectly mapped to 'Decoratorها و Descriptorها' instead of a proper Persian translation like 'اشاره‌های نوع' or keeping the English term, causing systematic mislabeling of the new Type hints section.
  • Iterators in for loops: The translation of iterator.___next___() preserves the triple underscore from the source (which itself has a typo - should be double underscore __next__), but this is carried over from the source so acceptable; however the section otherwise translates accurately.


🔍 Diff Quality

Check Status
Scope Correct
Position Correct
Structure Preserved
Heading-map Correct
Overall 2.5/10

Summary: The translation sync failed: the new 'Type hints' section body content is missing from the translation, the document structure is broken with duplicated 'Decorators and Descriptors' content after the (paf_generators)= anchor, and the heading-map entries for 'Type hints' use incorrect translations recycled from other sections.

Issues:

  • The new 'Type hints' section from the English source is missing in the translated document body — no Persian translation of the Type hints content was inserted
  • The (paf_generators)= anchor is followed by a duplicate '## Decoratorها و Descriptorها' section instead of '## Generatorها', causing the Generators section to appear duplicated
  • The heading-map maps 'Type hints' to 'Decoratorها و Descriptorها' which is incorrect — it reuses the translation for 'Decorators and Descriptors'
  • The heading-map maps 'Type hints::Basic syntax' to 'Decoratorها' and 'Type hints::Common types' to 'Descriptorها', both of which are wrong translations
  • Several subsections of Type hints are missing from the heading-map: 'Hints don't enforce types', 'Why use type hints?', 'Type hints in scientific Python'

This review was generated automatically by action-translation review mode.

@github-actions
Copy link

❌ Translation Quality Review

Verdict: FAIL | Model: claude-sonnet-4-6 | Date: 2026-03-24


📝 Translation Quality

Criterion Score
Accuracy 5/10
Fluency 7/10
Terminology 6/10
Formatting 3/10
Overall 5.5/10

Summary: The translation has critical structural problems. The entire newly added 'Type hints' section (with 5 subsections) is completely absent from the translation body, which is a major omission for an ADDED section in this PR. Furthermore, the content following the '(paf_generators)=' anchor incorrectly duplicates the 'Decorators and descriptors' section instead of rendering the 'Generators' section — this appears to be a copy-paste error causing the Generators section to be buried under incorrect headings. The heading-map also contains wrong mappings for Type hints entries. The sections that are correctly translated show good quality, but the structural and completeness errors make this translation unsuitable for publication without significant revision. The translated sections that are correctly rendered (Iterables and iterators, * and ** operators, Decorators and descriptors first occurrence, Generators) show good fluency and natural Persian phrasing. Technical terms like 'iterator', 'decorator', 'descriptor', 'generator' are handled consistently with appropriate Persian pluralization conventions (e.g., 'Iteratorها', 'Generatorها'). Code blocks, mathematical expressions, and MyST directives are correctly preserved in sections that were properly translated. The translation of procedural explanations (e.g., the check_nonneg decorator example walkthrough) is clear and accurate where present.

⚠️ Markdown Syntax Errors (CRITICAL)

  • 🔴 Critical structural error: The entire 'Decorators and descriptors' section content is duplicated. After the Generators section anchor '(paf_generators)=', the translation incorrectly repeats the full 'Decorators and descriptors' section (with heading '## Decoratorها و Descriptorها') instead of the '## Generatorها' section content.
  • 🔴 heading-map contains incorrect mappings: 'Type hints' maps to 'Decoratorها و Descriptorها' and 'Type hints::Basic syntax' maps to 'Decoratorها' — these are wrong section labels that would break navigation.
  • 🔴 The entire 'Type hints' section and all its subsections (Basic syntax, Common types, Hints don't enforce types, Why use type hints?, Type hints in scientific Python) are completely missing from the translation body — these were ADDED sections in this PR.
  • 🔴 The '## Iterables and iterators' section translation omits the sentence about type hints in the Overview: 'موضوعات متنوعی در این سخنرانی بررسی می‌شوند، از جمله iteratorها، decoratorها و descriptorها، و generatorها' — missing 'type hints' (راهنماهای نوع) compared to source which lists 'iterators, type hints, decorators and descriptors, and generators'.

Suggestions:

  • Overview section: 'iteratorها، decoratorها و descriptorها، و generatorها' → should be 'iteratorها، راهنماهای نوع، decoratorها و descriptorها، و generatorها' — the source explicitly lists 'type hints' as a topic but the translation omits it.
  • Type hints section (ADDED): The entire ## Type hints section and all five subsections are missing from the translation body. These are newly added sections that must be translated and included.
  • heading-map entry 'Type hints: Decoratorها و Descriptorها' is incorrect — it maps a new 'Type hints' section to the wrong heading. It should map to something like 'راهنماهای نوع'.
  • Structural duplication: After '(paf_generators)=', the Persian translation repeats the entire Decorators and descriptors section instead of the Generators section. The content starting with '## Decoratorها و Descriptorها' following the generators anchor must be replaced with the correct '## Generatorها' content.
  • Iterators in for loops section: 'iterator.next()' uses triple underscores in both source and translation — the source has this as 'next' which appears to be a typo for 'next', but since this matches the source it should be preserved consistently as-is.

🔍 Diff Quality

Check Status
Scope Correct
Position Correct
Structure Preserved
Heading-map Correct
Overall 2.5/10

Summary: The target document has critical structural corruption: the new 'Type hints' section is missing from the body entirely, its heading-map entries have wrong Persian values, and a duplicate 'Decorators and Descriptors' block was inserted where the 'Generators' section should follow the (paf_generators)= anchor.

Issues:

  • The new 'Type hints' section content was NOT inserted into the target document body — instead, the existing 'Decorators and Descriptors' section content was duplicated after the (paf_generators)= anchor, creating a doubled/corrupted section where 'Generators' content should be.
  • After (paf_generators)=, the target body shows '## Decoratorها و Descriptorها' again instead of '## Generatorها', meaning the Generators section heading and its unique content were replaced/overwritten by a duplicate of Decorators and Descriptors.
  • The heading-map entry for 'Type hints' maps to 'Decoratorها و Descriptorها' (the Persian for Decorators and Descriptors), which is incorrect — it should map to a Persian translation of 'Type hints' (e.g., 'نکات نوع' or 'راهنمایی‌های نوع').
  • The heading-map entries for 'Type hints::Basic syntax' and 'Type hints::Common types' map to 'Decoratorها' and 'Descriptorها' respectively, which are wrong translations — these should map to Persian translations of 'Basic syntax' and 'Common types'.
  • The entire 'Type hints' section body (including its subsections Basic syntax, Common types, Hints don't enforce types, Why use type hints, Type hints in scientific Python) is absent from the translated document body — no Persian translation or even placeholder was added.
  • The 'Generators' section in the target after document body appears twice: first correctly, then duplicated as part of the corrupted insertion, causing structural corruption.
  • The heading-map keys were updated to lowercase variants (e.g., 'Iterables and iterators', 'Decorators and descriptors') matching the source changes, but the body headings in the Persian translation were NOT updated to match — the body still uses the old-cased headings like '## Iterableها و Iteratorها' and '### Iteratorها در حلقه‌های For', creating a mismatch between heading-map keys and actual rendered headings.

This review was generated automatically by action-translation review mode.

@github-actions
Copy link

@github-actions github-actions bot temporarily deployed to pull request March 24, 2026 02:36 Inactive
@mmcky mmcky closed this Mar 24, 2026
@mmcky mmcky deleted the translation-sync-2026-03-24T02-30-41-pr-488 branch March 24, 2026 04:31
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.

1 participant