refactor: support i18n

This commit is contained in:
mlogclub
2026-05-25 12:06:15 +08:00
parent 309ac1fe9e
commit 988f55c80d
179 changed files with 10968 additions and 3763 deletions
+5 -3
View File
@@ -4,6 +4,7 @@ import { useRouter } from "next/navigation"
import { useState } from "react"
import { useAuth } from "@/components/auth-provider"
import { useI18n } from "@/i18n/provider"
import { ChangePasswordDialog } from "@/components/change-password-dialog"
import { useNotifications } from "@/components/notification-provider"
import { Badge } from "@/components/ui/badge"
@@ -43,6 +44,7 @@ export function NavUser({
avatar: string
}
}) {
const t = useI18n()
const { signOut } = useAuth()
const { unreadCount } = useNotifications()
const { isMobile } = useSidebar()
@@ -102,7 +104,7 @@ export function NavUser({
className="gap-2"
>
<BellIcon />
<span className="flex-1"></span>
<span className="flex-1">{t("nav.notifications")}</span>
{unreadCount > 0 ? (
<Badge className="h-5 min-w-5 px-1.5">
{unreadCount > 99 ? "99+" : unreadCount}
@@ -115,7 +117,7 @@ export function NavUser({
}}
>
<KeyRoundIcon />
{t("nav.changePassword")}
</DropdownMenuItem>
</DropdownMenuGroup>
<DropdownMenuSeparator />
@@ -125,7 +127,7 @@ export function NavUser({
}}
>
<LogOutIcon />
退
{t("nav.signOut")}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>