diff --git a/apps/user/app/(main)/(user)/document/document-button.tsx b/apps/user/app/(main)/(user)/document/document-button.tsx index 9992771..065f85f 100644 --- a/apps/user/app/(main)/(user)/document/document-button.tsx +++ b/apps/user/app/(main)/(user)/document/document-button.tsx @@ -9,9 +9,11 @@ import { useOutsideClick } from '@shadcn/ui/hooks/use-outside-click'; import { cn } from '@shadcn/ui/lib/utils'; import { useQuery } from '@tanstack/react-query'; import { AnimatePresence, motion } from 'framer-motion'; +import { useTranslations } from 'next-intl'; import { useEffect, useId, useRef, useState } from 'react'; export function DocumentButton({ items }: { items: API.DocumentItem[] }) { + const t = useTranslations('document'); const [active, setActive] = useState(null); const id = useId(); const ref = useRef(null); @@ -126,7 +128,7 @@ export function DocumentButton({ items }: { items: API.DocumentItem[] }) { 'rounded-full', )} > - 阅读 + {t('read')} ))} diff --git a/apps/user/app/(main)/(user)/document/tutorial-button.tsx b/apps/user/app/(main)/(user)/document/tutorial-button.tsx index 317ef72..776fc41 100644 --- a/apps/user/app/(main)/(user)/document/tutorial-button.tsx +++ b/apps/user/app/(main)/(user)/document/tutorial-button.tsx @@ -8,6 +8,7 @@ import { useOutsideClick } from '@shadcn/ui/hooks/use-outside-click'; import { cn } from '@shadcn/ui/lib/utils'; import { useQuery } from '@tanstack/react-query'; import { AnimatePresence, motion } from 'framer-motion'; +import { useTranslations } from 'next-intl'; import { useEffect, useId, useRef, useState } from 'react'; interface Item { @@ -15,6 +16,8 @@ interface Item { title: string; } export function TutorialButton({ items }: { items: Item[] }) { + const t = useTranslations('document'); + const [active, setActive] = useState(null); const id = useId(); const ref = useRef(null); @@ -143,7 +146,7 @@ export function TutorialButton({ items }: { items: Item[] }) { 'rounded-full', )} > - 阅读 + {t('read')} ))} diff --git a/apps/user/locales/en-US/document.json b/apps/user/locales/en-US/document.json index e8ea9c4..1834612 100644 --- a/apps/user/locales/en-US/document.json +++ b/apps/user/locales/en-US/document.json @@ -1,8 +1,6 @@ { - "back": "Back", - "category": "Category", + "all": "All", + "document": "Document", "read": "Read", - "tags": "Tags", - "title": "Title", - "updatedAt": "Updated At" + "tutorial": "Tutorial" } diff --git a/apps/user/locales/zh-CN/document.json b/apps/user/locales/zh-CN/document.json index 143ba40..333a601 100644 --- a/apps/user/locales/zh-CN/document.json +++ b/apps/user/locales/zh-CN/document.json @@ -1,5 +1,6 @@ { "all": "全部", "document": "文档", + "read": "阅读", "tutorial": "教程" }