Skip to content

Commit 1b84612

Browse files
committed
refactor(server): Replace i18n implementation
Replace direct use of i18n.t with react-i18next's useTranslation hook to improve internationalization support.
1 parent 88fbf89 commit 1b84612

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/server.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import {
3434
import { Switch } from "@/components/ui/switch"
3535
import { Textarea } from "@/components/ui/textarea"
3636
import { IconButton } from "@/components/xui/icon-button"
37-
import i18n from "@/lib/i18n"
3837
import {
3938
type PublicNote,
4039
applyPublicNoteDate,
@@ -55,6 +54,7 @@ import { zodResolver } from "@hookform/resolvers/zod"
5554
import { HelpCircle } from "lucide-react"
5655
import { useState } from "react"
5756
import { useForm } from "react-hook-form"
57+
import { useTranslation } from "react-i18next"
5858
import { toast } from "sonner"
5959
import { KeyedMutator } from "swr"
6060
import { z } from "zod"
@@ -92,7 +92,7 @@ const serverFormSchema = z.object({
9292
})
9393

9494
export const ServerCard: React.FC<ServerCardProps> = ({ data, mutate }) => {
95-
const t = i18n.t
95+
const { t } = useTranslation()
9696
const form = useForm({
9797
resolver: zodResolver(serverFormSchema) as any,
9898
defaultValues: {

0 commit comments

Comments
 (0)