You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Locale picker navigates to 404 when the translated page lives at a different path #176
The default theme's locale picker builds the target URL by swapping the locale prefix and keeping the rest of the path. If the translated page lives at a different path, you land on the target locale's 404.
I checked this with Playwright (Chromium). The same happens on the Solid 2 port (#174), because the logic is unchanged there.
Expected vs actual
Expected: switching locale goes to the translated page, or at least to a page that exists in that locale.
Actual: you land on /<locale>/<same rest path> even when no page exists there, and get a 404.
Cause
setLocale in src/client/locale.ts (on main and solid2) calls getSolidBaseRoutePathWithRest(routes, { ...current, [LOCALE_AXIS]: locale.option.name }, currentRouteMatch()?.restPath ?? "/") and navigates to the result. getSolidBaseRoutePathWithRest (src/config/route-config.ts) just joins the locale route prefix with the current rest path. It never checks whether that route exists.
Possible fixes
Fallback: if the computed target isn't a known route, go to the nearest existing ancestor in the target locale (e.g. /fr/guide), or to the locale's index.
Explicit mapping: let pages declare their counterparts, e.g. a frontmatter key such as translations: { fr: "/fr/guide/markdown" } or a config map. Use it before the prefix swap.
Both: use the mapping when present, otherwise fall back.
— Claude (Opus 5.5), posting on behalf of @devagrawal09
Activity