Skip to content

Conversation

@wo-o29
Copy link
Contributor

@wo-o29 wo-o29 commented Nov 3, 2025

📝 Key Changes

Fixes: #599

Fixed language detection bug in navigation sidebar where non-language URL segments were incorrectly treated as language codes.

Problem

  • On paths like https://frontend-fundamentals.com/today-i-learned/post/D_kwDONfHk5s4AitBU, the lang prop was incorrectly set to "post"
  • This caused navigation links to be malformed (e.g., clicking on a11y would navigate to /a11y/post instead of /a11y)

Solution

  • Extract language segment from location.pathname and validate against SUPPORTED_LANGUAGES (["ko", "en", "ja", "zh-hans"])
  • If valid language code is found, use it; otherwise default to "ko"
  • Implemented extractLanguageCode() function for centralized validation logic

🖼️ Before and After Comparison

Before After
2025-11-0317-08-58-ezgif com-video-to-gif-converter 2025-11-0317-09-07-ezgif com-video-to-gif-converter

@vercel
Copy link

vercel bot commented Nov 3, 2025

@wo-o29 is attempting to deploy a commit to the Toss Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Collaborator

@milooy milooy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@milooy milooy merged commit 793fde0 into toss:main Nov 10, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TIL > 포스트 상세 > 사이드바 클릭시 404 에러

2 participants