Repository navigation
Fix language switcher under /makerspace path prefix - #319
Merged
Merged
Conversation
… repair malformed URLs Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
poojanagvekar
enabled auto-merge
October 28, 2026 18:17
mimiflynn
previously approved these changes
Oct 28, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The route-existence set uses raw MDX slugs instead of generated home-page routes, causing valid repaired URLs such as /fr-CA/ to remain on the 404 page.
1 open issue
What changed in this PR
This PR fixes language switching under the production /makerspace prefix and improves navigation when translated content is unavailable.
Changes:
- Strip the deployment prefix before computing language-switch targets and active navigation links.
- Add parent-page fallback for missing translations and 404 recovery for malformed locale URLs.
- Add helper tests, document routing behavior, and link French Cutebot content.
| File | Description |
|---|---|
site/src/pages/404.js |
Adds malformed URL repair and redirect handling. |
site/src/i18n/index.spec.js |
Tests prefix stripping, translation fallback, and URL repair. |
site/src/i18n/index.js |
Adds path normalization, fallback, and repair helpers. |
site/src/components/header.jsx |
Uses prefix-aware navigation and translation fallback. |
site/README.md |
Documents routing behavior and the browser-extension warning. |
site/content/fr-CA/exercises/index.mdx |
Adds a direct link to French Cutebot content. |
Review effort: Balanced
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
mimiflynn
approved these changes
Oct 29, 2026
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.

Refs #317
Follow-up to #318.
Root cause: in production
location.pathnameincludes the/makerspaceprefix, so the language toggle built broken URLs like/fr-CA/makerspace/exercises/...(404).i18n/index.spec.js; README updated.The
content.js ... unloadconsole warning comes from a browser extension, not the site.Not run locally (no node in this environment); please rely on CI.
Related to #317 (French Cutebot pages / language links).