Skip to content

fix: 언어 변경 버튼 간헐적 미적용 — router.refresh()로 라우터 캐시 무효화 - #32

Merged
gunwoongPark merged 5 commits into
developfrom
fix/language-switcher
May 14, 2026
Merged

gunwoongPark merged 5 commits into
developfrom
fix/language-switcher

Conversation

@gunwoongPark

Copy link
Copy Markdown
Owner

문제

언어 변경 버튼 클릭 시 간헐적으로 언어가 바뀌지 않는 현상.

원인

router.replace()는 Next.js 라우터 캐시를 우선 사용합니다. 이전에 해당 경로(/en 등)를 방문한 적이 있으면 서버 요청 없이 캐시된 페이지를 반환하고, 미들웨어도 실행되지 않아 새 locale이 적용되지 않습니다.

수정

router.replace() 호출 후 router.refresh()를 추가해 서버 컴포넌트 재실행을 강제합니다.

router.replace(pathname, { locale: nextLocale })
router.refresh() // 라우터 캐시 무효화 → 서버 컴포넌트 재실행

gunwoongPark and others added 5 commits May 14, 2026 14:49
- PartyCard.tsx, PartyFrameView.tsx의 한국어 하드코딩 텍스트를 모두 next-intl로 교체
  - 역할 배지(탱/힐/근/원), 빈 슬롯, 파티 헤더, 배정 해제 버튼
  - 미배정 풀, 드래그 힌트, 자동 배치, 배정 초기화
- messages/ko.json, messages/en.json에 roster.partyFrame + role.badge 키 추가
- blizzardFetch region 누락 수정 (fetch-character-server.ts)
- characterApi / fetchCharacter region 인수 누락 수정
  (CharacterSearchForm.tsx, useRosterSync.ts)
- blizzard-client.ts non-null assertion 제거

Co-authored-by: Cursor <cursoragent@cursor.com>
- CharacterRow: realm 표시를 locale에 따라 한글/영문으로 전환
  - extractRealmSlug + getRealmDisplayName(slug, locale, koreanName)
- LogCell: 툴팁 타이틀 "보스별 로그 (평균 N)" → useTranslations 적용
- realms.ts: KR_REALM_SLUG_TO_EN 매핑 + getRealmDisplayName 유틸 추가
- messages ko/en: roster.logTooltip.title 키 추가

Co-authored-by: Cursor <cursoragent@cursor.com>
- global-error.tsx: next-intl Provider 밖이라 useTranslations 불가
  → NEXT_LOCALE 쿠키 / navigator.language 기반 locale 감지
  → useState lazy initializer로 초기 렌더 시 locale 결정
  → MESSAGES 맵으로 ko/en 분기, lang 속성도 동적 설정
- manifest.ts: PWA 설명을 영문으로 변경
  (Web App Manifest은 단일 URL로 제공돼 로케일 분기 불가)

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented May 14, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
raid-scope Ignored Ignored May 14, 2026 6:07am

@github-actions github-actions Bot added bug Something isn't working feature labels May 14, 2026
@gunwoongPark
gunwoongPark merged commit 1edb99d into develop May 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant