@@ -30,18 +30,22 @@ import { Avatar, AvatarFallback, AvatarImage } from "@/shared/components/avatar"
3030import { useState } from "react"
3131import { cn } from "@/shared/lib/utils"
3232import { useI18n } from "@/shared/providers/locale-provider"
33+ import { localizePathname } from "@/shared/i18n/config"
3334
3435export function Header ( ) {
35- const { t } = useI18n ( )
36+ const { t, locale } = useI18n ( )
3637 const { user, isAuthenticated } = useAuthStore ( )
3738 const hydrated = useAuthHydrated ( )
3839 const logoutMutation = useLogout ( )
3940 const router = useRouter ( )
4041 const [ showLogoutDialog , setShowLogoutDialog ] = useState ( false )
4142 const pathname = usePathname ( )
43+ const homePath = localizePathname ( "/" , locale )
44+ const rankingPath = localizePathname ( "/ranking" , locale )
45+ const loginPath = localizePathname ( "/login" , locale )
4246
4347 const handleLogin = ( ) => {
44- window . location . href = '/login'
48+ window . location . href = loginPath
4549 }
4650
4751 const handleLogoutClick = ( ) => {
@@ -51,7 +55,7 @@ export function Header() {
5155 const handleLogoutConfirm = async ( ) => {
5256 await logoutMutation . mutateAsync ( )
5357 setShowLogoutDialog ( false )
54- router . push ( '/' )
58+ router . push ( homePath )
5559 }
5660
5761 return (
@@ -60,7 +64,7 @@ export function Header() {
6064
6165 { /* Left Side: Logo & Navigation */ }
6266 < div className = "flex items-center gap-8" >
63- < Link href = "/" className = "flex items-center gap-2 transition-opacity hover:opacity-80" >
67+ < Link href = { homePath } className = "flex items-center gap-2 transition-opacity hover:opacity-80" >
6468 < GithubIcon className = "h-6 w-6 text-foreground" />
6569 < span className = "text-base font-bold tracking-tight text-foreground" >
6670 Git Ranker
@@ -69,7 +73,7 @@ export function Header() {
6973
7074 < nav className = "hidden md:flex items-center gap-6" >
7175 < Link
72- href = "/ranking"
76+ href = { rankingPath }
7377 className = { cn (
7478 "text-sm font-medium transition-colors hover:text-primary flex items-center gap-1.5" ,
7579 pathname . endsWith ( "/ranking" ) ? "text-foreground" : "text-muted-foreground"
@@ -84,7 +88,7 @@ export function Header() {
8488 { /* Right Actions */ }
8589 < div className = "flex items-center gap-1.5 sm:gap-3" >
8690 < Link
87- href = "/ranking"
91+ href = { rankingPath }
8892 className = "md:hidden p-2 text-muted-foreground hover:text-primary"
8993 aria-label = { t ( "header.ranking.aria" ) }
9094 >
@@ -134,15 +138,15 @@ export function Header() {
134138 { /* Menu Items */ }
135139 < div className = "p-2 space-y-1" >
136140 < DropdownMenuItem asChild className = "rounded-xl h-11 px-3 cursor-pointer transition-colors duration-150" >
137- < Link href = { `/users/${ user . username } ` } className = "flex items-center gap-3" >
141+ < Link href = { localizePathname ( `/users/${ user . username } ` , locale ) } className = "flex items-center gap-3" >
138142 < div className = "flex items-center justify-center w-8 h-8 rounded-full bg-primary/10" >
139143 < User className = "h-4 w-4 text-primary" />
140144 </ div >
141145 < span className = "text-[14px] font-medium" > { t ( "common.profile" ) } </ span >
142146 </ Link >
143147 </ DropdownMenuItem >
144148 < DropdownMenuItem asChild className = "rounded-xl h-11 px-3 cursor-pointer transition-colors duration-150" >
145- < Link href = "/settings" className = "flex items-center gap-3" >
149+ < Link href = { localizePathname ( "/settings" , locale ) } className = "flex items-center gap-3" >
146150 < div className = "flex items-center justify-center w-8 h-8 rounded-full bg-muted" >
147151 < Settings className = "h-4 w-4 text-muted-foreground" />
148152 </ div >
0 commit comments