Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n 로직 리팩터링 및 언어 전환 기능 개선 #55

Merged
merged 19 commits into from
Jan 23, 2025
Merged

Conversation

witch-factory
Copy link
Owner

  1. i18n 객체 기반으로 동작하도록 개선

기존 locales 배열을 사용하는 방식에서 i18n 객체를 활용하는 방식으로 변경하여 더 유연하고 확장 가능한 구조로 개선
언어 타입도 i18n 객체 기반의 Locale로 변경

  1. 언어 전환 로직 개선

언어 전환 로직을 next.js 라우터 핸들러로 일부 옮김
언어 전환 미들웨어 로직을 단순화하고, 리다이렉트 URL 생성 로직을 추가
사용자가 언어 전환시 쿠키에 새로운 언어를 저장
일치하는 언어가 없을 경우 HTTP 406 에러 코드를 반환하도록 변경

  1. 사용자 경험 및 접근성 개선

언어 전환 버튼에 aria 옵션을 설정해 접근성을 향상
useTransition을 활용하여 언어 전환 동작을 최적화하고, 전환 중 버튼이 비활성화되도록 CSS를 추가

  1. 추가 변경 사항

/api 하위로 조회수 카운트 라우트를 이동
빌드 시 타입 검사를 수행하도록 기존 옵션을 제거

Copy link

vercel bot commented Jan 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
witch-next-blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 23, 2025 5:57pm

@witch-factory witch-factory merged commit 3c2a03d into main Jan 23, 2025
3 checks passed
@witch-factory witch-factory deleted the i18n branch January 23, 2025 17:58
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.

1 participant