Skip to content

Preserve localised _toc.yml part captions on sync - #291

Open
kp992 wants to merge 2 commits into
QuantEcon:mainfrom
kp992:issue-254
Open

Preserve localised _toc.yml part captions on sync#291
kp992 wants to merge 2 commits into
QuantEcon:mainfrom
kp992:issue-254

Conversation

@kp992

@kp992 kp992 commented Aug 25, 2026

Copy link
Copy Markdown

When a sync run regenerated _toc.yml, it mirrored the source directly and silently overwrote any translated part captions in the target.

Two-part fix: fetch the existing target TOC in index.ts so it is available as targetContent, then in processTocFile call mergeTargetCaptions which matches source and target parts by file-set membership and carries the target's caption forward for unchanged parts. New parts with no target equivalent keep the source caption.

Fixes #254

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sync overwrites localised _toc.yml part captions with English, and nothing detects it

1 participant