i18n: terminology glossary + AI quality review (#1124)#1126
Merged
Conversation
- Added new glossary synchronization and management scripts: `sync-glossary.mjs` and `glossary.mjs` for handling term translations. - Introduced new commands in `package.json` for glossary synchronization and dry-run checks. - Removed outdated scripts: `check-ja.ts`, `fix-zh-leaks.ts`, and `zh-ja-dict.ts`. - Updated `translate-i18n.ts` to incorporate glossary prompts during translation. - Added new glossary files for Japanese and Korean translations. This update improves the handling of translation terms and enhances the overall i18n workflow.
- Revised the .env.local.example file to include updated API keys and URLs for OpenRouter and DeepSeek, enhancing clarity on usage. - Added a new command `npm run glossary:sync` to the README files for rebuilding the terminology glossary from the ComfyUI frontend, ensuring consistency across translations. - Removed the outdated glossary README file to streamline documentation. These changes improve the setup process for developers and enhance the overall translation workflow.
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Contributor
|
Thanks for picking this up so quickly! The override layer for recording term decisions is a cleaner approach than I had in mind. Looks great. |
New `npm run translate:review` scores existing translations with an independent, typically cheaper model on four axes (accuracy, completeness, terminology checked against the glossary, fluency) and lists concrete issues. - Advisory only: reports to .github/i18n-logs/review/ (gitignored), never into MDX, never blocking. Independent of the translation model's own MISMATCH self-notes. - Incremental: reviews only up-to-date, not-yet-reviewed translations; review state in a side reviewed.json, not in frontmatter. - Configurable judge via REVIEW_API_* (falls back to TRANSLATE_*); retry with backoff on transient network / 5xx / 429 errors. - Flags: --lang, --all, --sample N, --min-score N, --snippets, file args. Docs (root + i18n README) and .env.local.example updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The reviewed English-source hash now lives as `reviewSourceHash` in the translated file's frontmatter (snippets: an MDX comment), committed to git — mirroring `translationSourceHash`. This makes review state shared across the team and visible per file, rather than a local-only `.github/i18n-logs/` side file that wasn't tracked. - Incremental skip now reads reviewSourceHash from the translated file. - Only the hash goes in frontmatter; scores and the issue list stay in the gitignored quality-report. - Removed the reviewed.json side file and REVIEW_STATE_JSON constant. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves the docs translation pipeline with terminology consistency and AI quality review, addressing the term drift described in #1124 (e.g. "custom node" rendered as both 맞춤형 노드 and 커스텀 노드 in Korean).
Two features land here:
Plus cleanup of obsolete ZH→JA leak-fixing tooling.
1. Terminology glossary
Three complementary mechanisms feed the translator, each for a different category of term:
preserve_terms(existing)checkpoint,LoRA,schedulerglossary/frontend/{lang}.jsonworkflow → 워크플로glossary/overrides/{lang}.jsoncustom node → 커스텀 노드glossary/frontend/{lang}.json— a machine mirror of the ComfyUI frontend locales (the authoritative source of term translations). Rebuilt wholesale bynpm run glossary:sync; never hand-edited.glossary/overrides/{lang}.json— hand-maintained, wins over the mirror. The place to record a term decision (Inconsistent terminology in translated docs (no term-mapping mechanism) #1124) or drop a noisy frontend term:{ "terms": { "custom node": "커스텀 노드" }, "ignore": ["title", "additional", "work"] }translation-config.json,npm run glossary:syncgenerates its frontend mirror (provided the frontend ships that locale). The override file is optional.Design notes
of → 중,work → 업무용). A curated common-word blocklist (not a length filter —node/modelandwork/modeare the same length) drops these at sync time; the long tail goes in overrideignore.preserve_terms(expanded withembedding,scheduler,sampler,latent, etc.), kept in English — the opposite of the glossary.2. AI quality review (LLM-as-a-judge)
npm run translate:reviewscores existing translations with an independent (typically cheaper) model on four axes — accuracy, completeness, terminology (checked against the glossary), and fluency — and lists concrete issues..github/i18n-logs/review/(gitignored). Never blocks a PR; independent of the translation model's own=== MISMATCHES ===self-notes.reviewSourceHashin the translated file's frontmatter (snippets: an MDX comment), mirroringtranslationSourceHash. This makes review state shared across the team and visible per file. Only the hash goes in frontmatter — scores/issues stay in the report.REVIEW_API_KEY/REVIEW_API_BASE_URL/REVIEW_API_MODEL(falls back toTRANSLATE_*). Retries with backoff on transient network / 5xx / 429 errors.Example of a real flagged finding from a trial run:
3. Cleanup
fix-zh-leaks.ts,zh-ja-dict.ts,check-ja.ts): the pipeline is English-primary now, so Chinese can't leak into Japanese, and these had no main-pipeline or CI references.Docs & config
.github/scripts/i18n/README.mddocumenting the full i18n flow, glossary design, and quality review; root README and localized contributing guides updated..env.local.example: added OpenRouter example,FRONTEND_LOCALES_PATH, andREVIEW_API_*.Closes #1124
🤖 Generated with Claude Code