-
Notifications
You must be signed in to change notification settings - Fork 64
fix(i18n): preserve locale selection across navigation and prevent CORS errors #730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Pratham Kamthan <prathamkamthan1306@gmail.com>
…nalization support in Navbar Signed-off-by: Pratham Kamthan <prathamkamthan1306@gmail.com>
Signed-off-by: Pratham Kamthan <prathamkamthan1306@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome to KubeStellar! 🚀 Thank you for submitting this Pull Request. Before your PR can be merged, please ensure: ✅ DCO Sign-off - All commits must be signed off with ✅ PR Title - Must start with an emoji: ✨ (feature), 🐛 (bug fix), 📖 (docs), 🌱 (infra/tests), Getting Started with KubeStellar: Contributor Resources:
🌟 Help KubeStellar Grow - We Need Adopters! Our roadmap is driven entirely by adopter feedback. Whether you're using KubeStellar yourself or know someone who could benefit from multi-cluster Kubernetes: 📋 Take our Multi-Cluster Survey - Share your use cases and help shape our direction! A maintainer will review your PR soon. Feel free to ask questions in the comments or on Slack! |
|
Hi @rudy128. Thanks for your PR. I'm waiting for a kubestellar member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
✅ Deploy Preview for kubestellar-docs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@naman9271 @oksaumya please review this |
📌 Fixes
Fixes #605
📝 Summary of Changes
This PR fixes critical localization issues where users were being redirected to English (
/en) pages when navigating from non-English locales. The issue occurred when users selected a language (e.g., Japanese, Spanish, German) and then navigated to certain pages like/ladder,/partners, or clicked links from the documentation navbar.Key Problems Solved:
/ladder,/partners, or contact pages/es/docs/...) were not being redirected to the English-only documentationChanges Made
1. Middleware Updates (
src/middleware.ts)/ladderfrom the i18n middleware exclusion list to enable locale processing/es/docs/...→/docs/...)2. Navbar Component (
src/components/Navbar.tsx)LocalizedLink(from@/i18n/navigation) and regularLink(fromnext/link)/ladderlinks to useLocalizedLinkfor locale preservation (desktop & mobile)/partnerslinks to useLocalizedLinkfor locale preservation (desktop & mobile)/#contactlinks to useLocalizedLinkfor locale preservation (desktop & mobile)/docs/...links using regularLinkto maintain English-only documentation3. DocsNavbar Component (
src/components/docs/DocsNavbar.tsx)getBaseUrlimport to properly construct absolute URLs/ladderlinks to usegetBaseUrl()to prevent CORS errors (desktop & mobile)/partnerslinks to usegetBaseUrl()to prevent CORS errors (desktop & mobile)/#contactlinks to usegetBaseUrl()to prevent CORS errors (desktop & mobile)Checklist
Please ensure the following before submitting your PR:
Screenshots or Logs (if applicable)
output.mp4
Before Fix:
output.mp4
After Fix:
👀 Reviewer Notes
Testing Recommendations:
/ladder,/partners, and/#contactpreserves the locale/docspages that clicking Ladder/Partners/Contact links work without CORS errors/ja/docs/...) redirects to/docs/...Architecture Notes:
LocalizedLinkfor i18n pages and regularLinkfor docsgetBaseUrl()for cross-environment compatibility (localhost vs production)