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
fix: implement proper localized routing for all navigation links
Issue Fixed:
- Navigation links were hardcoded to English routes (/blog, /projects, /contact)
- When on Vietnamese page (/vi/), clicking nav links would switch back to English
- Language context was not preserved when navigating between pages
Solution:
- Updated Navbar to use getLocalizedPath() for all navigation links
- Updated Footer "Discover" section to use localized paths
- Updated all internal links on homepage (CTA buttons, View All links)
- Logo now links to correct language homepage (/ or /vi/)
How It Works:
- getLocalizedPath('/projects', 'en') → '/projects'
- getLocalizedPath('/projects', 'vi') → '/vi/projects'
- Language stays consistent when navigating through the site
Example Flow:
1. User on /vi/ (Vietnamese homepage)
2. Clicks "Dự Án" in navbar
3. Goes to /vi/projects (stays in Vietnamese) ✅
4. Previously went to /projects (switched to English) ❌
All Links Updated:
- ✅ Navbar: Blog, Projects, Contact, Logo
- ✅ Footer: Blog, Projects, Contact
- ✅ Homepage: All CTA buttons, View My Work, Get in Touch, View All Projects, View All Articles
- ✅ Mobile menu: All navigation links
Build Status:
- ✅ 19 pages built successfully
- ✅ 0 errors, 1 minor warning (unused import)
- ✅ All routes functional
Testing:
1. Visit http://localhost:4321/vi/
2. Click "Dự Án" → Goes to /vi/projects ✅
3. Click "Blog" → Goes to /vi/blog ✅
4. Click "Liên Hệ" → Goes to /vi/contact ✅
5. Language context preserved throughout navigation!
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments