[PR #190] [MERGED] fix: catch technical-translation preambles under the H1 #187

Closed
opened 2026-10-26 22:10:24 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/embedded-docs/pull/190
Author: @comfyui-wiki
Created: 10/18/2026
Status: ✅ Merged
Merged: 10/18/2026
Merged by: @comfyui-wiki

Base: main ← Head: cursor/ja-preamble-detector-8c7c


📝 Commits (4)

  • 050bef9 fix: catch technical-translation preambles under the H1
  • 184b7bb fix: keep ordinary translation descriptions under the H1
  • 9543f57 fix: require affirmative translation-preamble claims
  • e92a057 fix: end 以下是…译文 at a sentence boundary

📊 Changes

3 files changed (+279 additions, -8 deletions)

View changed files

📝 comfyui_embedded_docs/docs/MagnificImageRelightNode/zh-TW.md (+0 -2)
📝 docs-generation/scripts/fix_translation_preamble.py (+21 -6)
➕ docs-generation/tests/test_translation_preamble.py (+258 -0)

📄 Description

Summary

PR #189 removed this Japanese lead from SAM3_TrackToMask/ja.md:

これはComfyUIノードドキュメントの技術翻訳です。以下が日本語訳になります。

strip_leak missed it. PREAMBLE_SENTENCES["ja"] only matched 以下が日本語訳 at line start (^). On that line the clause comes after 。, and the opener is これは…技術翻訳です, which no pattern covered. The same gap exists for the Chinese and Korean "this is a technical translation of the ComfyUI node docs" shape.

PREAMBLE_SENTENCES now also matches, still only as a strong marker directly under the H1:

  • ja: これは…技術翻訳 at the start of a sentence (a following ではありません / じゃない does not count), 技術翻訳です。, and 以下が日本語訳 after 。 as well as at line start
  • zh / zh-TW: 这是 / 本文是…技术翻译 and 這是 / 本文是…技術翻譯, plus a sentence that ends on 以下是…翻译/译文 (and the Traditional Chinese equivalent, including 以下是繁體中文翻譯結果:)
  • ko: 기술 번역입니다, 이것은 / 이 문서는…기술 번역, and 다음은 한국어 번역 after a period

An overview that only mentions translation or docs, a negated "this is not a technical translation", or the same sentence later in the body is left in place.

Extra leak of the same class

A full-tree strip_leak scan found one published page with this shape. It is removed in this PR:

  • comfyui_embedded_docs/docs/MagnificImageRelightNode/zh-TW.md opened with 以下是繁體中文翻譯結果:

No other 技術翻訳 / 技术翻译 / 技術翻譯 / 기술 번역 hits remain in published docs. Those phrases still appear in the translator prompt templates.

Verification

  • python3 -m unittest docs-generation.tests.test_translation_preamble docs-generation.tests.test_language_inventory
  • Reconstructed the #189 page (leaked line under the H1, real overview kept). strip_leak returned removed count 4. --check-only on that file exited 1. A second pass removed nothing.
  • After the zh-TW cleanup, a scan of all 14,756 localized pages reported 0 remaining hits.
  • check_doc_structure.py --changed-only and check_md_format.py --changed-only against origin/main both passed.
Open in Web Open in Cursor 

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/embedded-docs/pull/190 **Author:** [@comfyui-wiki](https://github.com/comfyui-wiki) **Created:** 10/18/2026 **Status:** ✅ Merged **Merged:** 10/18/2026 **Merged by:** [@comfyui-wiki](https://github.com/comfyui-wiki) **Base:** `main` ← **Head:** `cursor/ja-preamble-detector-8c7c` --- ### 📝 Commits (4) - [`050bef9`](https://github.com/Comfy-Org/embedded-docs/commit/050bef90a0c8f5db6ca79ddbad6231b21359fa70) fix: catch technical-translation preambles under the H1 - [`184b7bb`](https://github.com/Comfy-Org/embedded-docs/commit/184b7bb800ac66dced41e07fc64df797d746eb6c) fix: keep ordinary translation descriptions under the H1 - [`9543f57`](https://github.com/Comfy-Org/embedded-docs/commit/9543f573140e9d2a3ee1f42782e460f27144e581) fix: require affirmative translation-preamble claims - [`e92a057`](https://github.com/Comfy-Org/embedded-docs/commit/e92a0575ff1d649f012393999637428ebe48680e) fix: end 以下是…译文 at a sentence boundary ### 📊 Changes **3 files changed** (+279 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `comfyui_embedded_docs/docs/MagnificImageRelightNode/zh-TW.md` (+0 -2) 📝 `docs-generation/scripts/fix_translation_preamble.py` (+21 -6) ➕ `docs-generation/tests/test_translation_preamble.py` (+258 -0) </details> ### 📄 Description <!-- CURSOR_AGENT_PR_BODY_BEGIN --> ## Summary PR #189 removed this Japanese lead from `SAM3_TrackToMask/ja.md`: > これはComfyUIノードドキュメントの技術翻訳です。以下が日本語訳になります。 `strip_leak` missed it. `PREAMBLE_SENTENCES["ja"]` only matched `以下が日本語訳` at line start (`^`). On that line the clause comes after `。`, and the opener is `これは…技術翻訳です`, which no pattern covered. The same gap exists for the Chinese and Korean "this is a technical translation of the ComfyUI node docs" shape. `PREAMBLE_SENTENCES` now also matches, still only as a strong marker directly under the H1: - **ja**: `これは…技術翻訳` at the start of a sentence (a following `ではありません` / `じゃない` does not count), `技術翻訳です。`, and `以下が日本語訳` after `。` as well as at line start - **zh / zh-TW**: `这是` / `本文是…技术翻译` and `這是` / `本文是…技術翻譯`, plus a sentence that ends on `以下是…翻译/译文` (and the Traditional Chinese equivalent, including `以下是繁體中文翻譯結果:`) - **ko**: `기술 번역입니다`, `이것은` / `이 문서는…기술 번역`, and `다음은 한국어 번역` after a period An overview that only mentions translation or docs, a negated "this is not a technical translation", or the same sentence later in the body is left in place. ## Extra leak of the same class A full-tree `strip_leak` scan found one published page with this shape. It is removed in this PR: - `comfyui_embedded_docs/docs/MagnificImageRelightNode/zh-TW.md` opened with `以下是繁體中文翻譯結果:` No other `技術翻訳` / `技术翻译` / `技術翻譯` / `기술 번역` hits remain in published docs. Those phrases still appear in the translator prompt templates. ## Verification - `python3 -m unittest docs-generation.tests.test_translation_preamble docs-generation.tests.test_language_inventory` - Reconstructed the #189 page (leaked line under the H1, real overview kept). `strip_leak` returned removed count `4`. `--check-only` on that file exited `1`. A second pass removed nothing. - After the zh-TW cleanup, a scan of all 14,756 localized pages reported 0 remaining hits. - `check_doc_structure.py --changed-only` and `check_md_format.py --changed-only` against `origin/main` both passed. <!-- CURSOR_AGENT_PR_BODY_END --> <div><a href="https://cursor.com/agents/bc-880430c1-c273-5c39-816c-0e98b7518c7c?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/background-agent?bcId=bc-880430c1-c273-5c39-816c-0e98b7518c7c&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/embedded-docs#187
No description provided.