Skip to content

feat(i18n): fallback to English MDX when a sidebar guide is untranslated#48

Open
SBrendan wants to merge 1 commit into
developfrom
feat/auto-fallback-missing-trad
Open

feat(i18n): fallback to English MDX when a sidebar guide is untranslated#48
SBrendan wants to merge 1 commit into
developfrom
feat/auto-fallback-missing-trad

Conversation

@SBrendan

Copy link
Copy Markdown
Collaborator

Adds a Rspress plugin that walks config/sidebar/index.md, and for each guide referenced there but missing under docs/{locale}/, registers a synthetic route via addPages({ routePath, filepath }) pointing at the English source. The URL stays at /{locale}/..., no symlink or stub file is written on disk, and pages outside the sidebar still 404 as before.

Wired into both rspress.config.ts (dev) and rspress.config.build.ts (per-locale prod build). In dev the route prefix is derived from the default locale; in prod base=/{locale}/ already prefixes so routePath stays bare.

Adds a Rspress plugin that walks config/sidebar/index.md, and for each
guide referenced there but missing under docs/{locale}/, registers a
synthetic route via addPages({ routePath, filepath }) pointing at the
English source. The URL stays at /{locale}/..., no symlink or stub file
is written on disk, and pages outside the sidebar still 404 as before.

Wired into both rspress.config.ts (dev) and rspress.config.build.ts
(per-locale prod build). In dev the route prefix is derived from the
default locale; in prod base=/{locale}/ already prefixes so routePath
stays bare.
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.

1 participant