November 22, 2025 - Building a Multi-Language Website
π― Goal
Today I worked on implementing multi-language support for my personal website using Nextra and Next.js. The goal was to add English, Simplified Chinese, and Traditional Chinese support.
β‘ Challenges Faced
Nextra Configuration Issues
- Hydration errors: Kept running into React hydration mismatches when trying to add language selectors
- Directory structure: Had to restructure the entire pages directory multiple times
- CSS conflicts: Custom CSS hiding rules interfered with Nextra's natural behavior
Navigation Problems
- Mixed language display: Initially showed all language directories in the navigation
- User feedback: Language icons overlapped with GitHub icon
- Complex solutions tried: Attempted Next.js i18n, custom React components, DOM manipulation
π§ Solutions That Worked
Final Architecture
pages/
βββ index.mdx # English homepage
βββ about-me.mdx # English pages
βββ ai-tech/
βββ ai-pm.mdx
βββ projects.mdx
βββ blog.mdx
βββ contact.mdx
βββ blog/
β βββ tech-diary.mdx # Tech diary section
β βββ tech-diary/
β βββ 2025-11-22.mdx # Individual diary entries
βββ _meta.json # English navigation configKey Learnings
- Simplicity wins: Complex CSS hiding rules caused more problems than they solved
- Nextra conventions: Let the framework handle routing naturally rather than fighting it
- User feedback loop: Real user testing revealed issues that automated tests missed
π Reflection
Today was a reminder that sometimes the simplest solution is the best one. I spent hours trying to perfect the multi-language implementation, only to realize that removing the complexity entirely was the right answer for this personal website.
Mood: π€ Challenging but rewarding Weather: Cloudy Coffee Count: 3 cups