[PR #205] [MERGED] docs-generation: use the frontend's localized node name for sidebarTitle #203

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

📋 Pull Request Information

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

Base: main ← Head: docs/localized-node-titles


📝 Commits (1)

  • fc575a8 docs-generation: use the frontend's localized node name for sidebarTitle

📊 Changes

1 file changed (+58 additions, -4 deletions)

View changed files

📝 docs-generation/scripts/sync_to_comfy_docs.py (+58 -4)

📄 Description

Every localized node page currently shows an English name in the sidebar, because build_frontmatter() writes the API node type into sidebarTitle (and into the title prefix) for every locale:

sidebarTitle: "CheckpointLoaderSimple"
title: "CheckpointLoaderSimple - ComfyUI Built-in Node Documentation"

The frontend already ships a translated display_name for these nodes (ComfyUI_frontend/src/locales/<lang>/nodeDefs.json), and sync_frontend_translations.py already reads it for parameter/output translations. This PR uses the same source for the page label.

Changes

  • localized_node_label(node_type, lang_code) returns the frontend display_name, falling back to the English node type.
  • _frontend_display_names() caches per locale, prefers FRONTEND_LOCALES_PATH (a local ComfyUI_frontend/src/locales checkout, same convention as the docs glossary sync) and otherwise fetches ComfyUI_frontend/main/src/locales/<lang>/nodeDefs.json. A locale without nodeDefs.json, a network error or an unparsable file only prints a warning and keeps the English name, so a sync run never fails on this.
  • build_frontmatter(node_name, description, label) puts the localized label in sidebarTitle and in the title prefix; the - ComfyUI Built-in Node Documentation suffix stays English, as it is today for every locale.

Effect (generated against a docs checkout, --node CheckpointLoaderSimple)

--- es/built-in-nodes/CheckpointLoaderSimple.mdx
title: "Cargar punto de control - ComfyUI Built-in Node Documentation"
sidebarTitle: "Cargar punto de control"
--- zh/built-in-nodes/CheckpointLoaderSimple.mdx
title: "Checkpoint加载器(简易) - ComfyUI Built-in Node Documentation"
sidebarTitle: "Checkpoint加载器(简易)"
  • pytest docs-generation/tests: 110 passed, 1 failed (test_translation_fixes.py::DryRunTests::test_persian_outputs_section_detected), and that failure reproduces on origin/main.
  • No page is regenerated by this PR. The docs repository needs a fresh sync to pick it up: the Spanish set is in flight (Comfy-Org/docs#2107), and en/zh/ja/ko would change on their next full sync, which is a separate pull request because it rewrites ~3200 existing pages.

🔄 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/205 **Author:** [@lin-bot23](https://github.com/lin-bot23) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@comfyui-wiki](https://github.com/comfyui-wiki) **Base:** `main` ← **Head:** `docs/localized-node-titles` --- ### 📝 Commits (1) - [`fc575a8`](https://github.com/Comfy-Org/embedded-docs/commit/fc575a8190916f9683bae96e5b072d59c76d5f2b) docs-generation: use the frontend's localized node name for sidebarTitle ### 📊 Changes **1 file changed** (+58 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `docs-generation/scripts/sync_to_comfy_docs.py` (+58 -4) </details> ### 📄 Description Every localized node page currently shows an **English name in the sidebar**, because `build_frontmatter()` writes the API node type into `sidebarTitle` (and into the `title` prefix) for every locale: ``` sidebarTitle: "CheckpointLoaderSimple" title: "CheckpointLoaderSimple - ComfyUI Built-in Node Documentation" ``` The frontend already ships a translated `display_name` for these nodes (`ComfyUI_frontend/src/locales/<lang>/nodeDefs.json`), and `sync_frontend_translations.py` already reads it for parameter/output translations. This PR uses the same source for the page label. **Changes** - `localized_node_label(node_type, lang_code)` returns the frontend `display_name`, falling back to the English node type. - `_frontend_display_names()` caches per locale, prefers `FRONTEND_LOCALES_PATH` (a local `ComfyUI_frontend/src/locales` checkout, same convention as the docs glossary sync) and otherwise fetches `ComfyUI_frontend/main/src/locales/<lang>/nodeDefs.json`. A locale without `nodeDefs.json`, a network error or an unparsable file only prints a warning and keeps the English name, so a sync run never fails on this. - `build_frontmatter(node_name, description, label)` puts the localized label in `sidebarTitle` and in the `title` prefix; the ` - ComfyUI Built-in Node Documentation` suffix stays English, as it is today for every locale. **Effect** (generated against a docs checkout, `--node CheckpointLoaderSimple`) ``` --- es/built-in-nodes/CheckpointLoaderSimple.mdx title: "Cargar punto de control - ComfyUI Built-in Node Documentation" sidebarTitle: "Cargar punto de control" --- zh/built-in-nodes/CheckpointLoaderSimple.mdx title: "Checkpoint加载器(简易) - ComfyUI Built-in Node Documentation" sidebarTitle: "Checkpoint加载器(简易)" ``` - `pytest docs-generation/tests`: 110 passed, 1 failed (`test_translation_fixes.py::DryRunTests::test_persian_outputs_section_detected`), and that failure reproduces on `origin/main`. - No page is regenerated by this PR. The docs repository needs a fresh sync to pick it up: the Spanish set is in flight (Comfy-Org/docs#2107), and `en`/`zh`/`ja`/`ko` would change on their next full sync, which is a separate pull request because it rewrites ~3200 existing pages. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 22:10:42 +00:00
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#203
No description provided.