Skip to content

fix: 헤더 메뉴 로케일 prefix 중복 수정#27

Merged
umsungjun merged 1 commit into
mainfrom
fix/header-locale-prefix-dup
Jun 20, 2026
Merged

fix: 헤더 메뉴 로케일 prefix 중복 수정#27
umsungjun merged 1 commit into
mainfrom
fix/header-locale-prefix-dup

Conversation

@umsungjun

@umsungjun umsungjun commented Jun 20, 2026

Copy link
Copy Markdown
Owner
  • next-intl Link가 현재 로케일을 자동으로 붙이는데 navItems에서 /${locale}를 직접 넣어 en 전환 시 /en/en/cheer처럼 prefix가 중복됨
  • href를 로케일 없는 경로로 바꿔 해결
  • usePathname() 반환값과 형식이 맞아 기존에 정상 동작하지 않던 active도 정상화 처리

Summary by CodeRabbit

릴리스 노트

  • Refactor
    • 내부 라우팅 로직을 개선하여 다국어 경로 처리 방식을 최적화했습니다. 사용자에게 보이는 기능이나 동작에는 변화가 없습니다.

- next-intl Link가 현재 로케일을 자동으로 붙이는데 navItems에서 /${locale}를 직접 넣어 en 전환 시 /en/en/cheer처럼 prefix가 중복됨
- href를 로케일 없는 경로로 바꿔 해결
- usePathname() 반환값과 형식이 맞아 기존에 정상 동작하지 않던 active도 정상화 처리
Copilot AI review requested due to automatic review settings June 20, 2026 12:43
@vercel

vercel Bot commented Jun 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lets-ko Ready Ready Preview, Comment Jun 20, 2026 12:43pm

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a9b4263e-4b08-44f3-96e9-af37122c6020

📥 Commits

Reviewing files that changed from the base of the PR and between 6bb135b and bdc8b2b.

📒 Files selected for processing (1)
  • src/components/layout/Header.tsx

📝 Walkthrough

Walkthrough

Header.tsx에서 navItemshref 값과 로고 Linkhref를 수동으로 /${locale}을 prefix하던 방식에서, next-intlLink 컴포넌트가 로케일 prefix를 자동으로 추가한다는 전제 하에 locale 없는 경로(/, /predictions 등)로 변경. 관련 주석도 추가됨.

Changes

Header 로케일 prefix 자동화

Layer / File(s) Summary
navItems 및 로고 href에서 수동 locale prefix 제거
src/components/layout/Header.tsx
navItems 각 항목의 href/${locale}... 형태에서 locale 없는 경로로 변경하고, 헤더 로고 Linkhref/${locale}에서 /로 수정. next-intl Link의 자동 locale prefix 동작 및 prefix 중복 이슈에 대한 주석 추가.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • umsungjun/lets-ko#12: 동일하게 src/components/layout/Header.tsx를 수정하여 수동 /${locale} prefix 방식에서 next-intl 라우팅 동작(Link 및 네비게이션 헬퍼)으로 전환하는 내용을 다루고 있음.

Poem

🐰 토끼가 경로를 정리했어요~

/${locale} 붙이던 손,
이제 next-intl에게 맡겨요.
/만 써도 알아서 척척,
중복 없이 깔끔하게!
🌍✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/header-locale-prefix-dup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@umsungjun umsungjun merged commit 63f7c6c into main Jun 20, 2026
3 of 4 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

헤더 네비게이션에서 next-intlLink가 로케일 prefix를 자동 부여하는 동작을 고려해, 메뉴 링크가 /en/en/...처럼 중복 prefix를 만들던 문제를 해결하는 PR입니다. 또한 usePathname()href 형식을 일치시켜 활성(Active) 상태 표시가 정상 동작하도록 맞춥니다.

Changes:

  • navItemshref에서 /${locale} prefix를 제거해 로케일 전환 시 중복 경로 생성을 방지
  • 로고(Link) 홈 이동 경로를 로케일 없는 "/"로 통일
  • pathname === item.href 비교가 기대한 형태로 동작하도록 경로 형식 정리

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.

2 participants