Conversation
홈에서 블로그 포스트 클릭 시 영문 UI로 표시되는 버그 수정. 기존 /article/... 경로의 콘텐츠는 모두 한국어이므로, 이 경로에서는 쿠키의 locale을 무시하고 기본 locale(ko)을 사용하도록 변경.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- useLocale()에서 쿠키 기반 locale 로직 제거 - URL에 locale이 명시된 경우(/ko/..., /en/...)만 해당 locale 사용 - 그 외 모든 경로는 기본 locale(ko) 사용 - 언어 전환 링크도 쿠키 설정 없이 직접 이동하도록 변경 이 변경으로 경로 간 이동 시 locale이 일관되게 유지됩니다.
쿠키 기반 locale 설정을 사용하지 않으므로 set-locale 엔드포인트 삭제
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the locale selection logic in the
useLocalehook to improve how the user's language preference is determined based on the URL path and cookies. The new logic ensures that Korean content routes always use the default locale and prioritizes extracting the locale from the pathname.Locale selection logic improvements:
useLocaleinsrc/modules/i18n/useLocale.tsto prioritize extracting the locale from the pathname, enforce default locale for/article/...routes, and fall back to the cookie or default locale for other cases.