diff --git a/apps/client/public/locales/en/page.json b/apps/client/public/locales/en/page.json index ed125634..96d8f126 100644 --- a/apps/client/public/locales/en/page.json +++ b/apps/client/public/locales/en/page.json @@ -22,5 +22,12 @@ "Full width": "Full width", "Page history": "Page history", "Export": "Export", - "Print PDF": "Print PDF" + "Print PDF": "Print PDF", + "Error loading page history.": "Error loading page history.", + "No page history saved yet.": "No page history saved yet.", + "Please confirm your action": "Please confirm your action", + "Are you sure you want to restore this version? Any changes not versioned will be lost.": "Are you sure you want to restore this version? Any changes not versioned will be lost.", + "Confirm": "Confirm", + "Successfully restored": "Successfully restored", + "Restore": "Restore" } diff --git a/apps/client/public/locales/en/translation.json b/apps/client/public/locales/en/translation.json index ccdfd01d..f6fcd395 100644 --- a/apps/client/public/locales/en/translation.json +++ b/apps/client/public/locales/en/translation.json @@ -38,19 +38,5 @@ }, "home": { "Recently updated": "Recently updated" - }, - "space": {}, - "page": {}, - "page-history": { - "Page history": "Page history", - "Error loading page history.": "Error loading page history.", - "No page history saved yet.": "No page history saved yet.", - "Please confirm your action": "Please confirm your action", - "Are you sure you want to restore this version? Any changes not versioned will be lost.": "Are you sure you want to restore this version? Any changes not versioned will be lost.", - "Confirm": "Confirm", - "Cancel": "Cancel", - "Successfully restored": "Successfully restored", - "Restore": "Restore", - "Error fetching page data.": "Error fetching page data." } } diff --git a/apps/client/public/locales/zh/page.json b/apps/client/public/locales/zh/page.json index ed098796..5d7dbc00 100644 --- a/apps/client/public/locales/zh/page.json +++ b/apps/client/public/locales/zh/page.json @@ -22,5 +22,12 @@ "Full width": "全宽", "Page history": "页面历史", "Export": "导出", - "Print PDF": "打印 PDF" + "Print PDF": "打印 PDF", + "Error loading page history.": "加载页面历史时出错。", + "No page history saved yet.": "尚未保存页面历史。", + "Please confirm your action": "请确认您的操作", + "Are you sure you want to restore this version? Any changes not versioned will be lost.": "您确定要恢复此版本吗?任何未版本化的更改将会丢失。", + "Confirm": "确认", + "Successfully restored": "恢复成功", + "Restore": "恢复" } diff --git a/apps/client/public/locales/zh/translation.json b/apps/client/public/locales/zh/translation.json index c7fba0c6..1a635c27 100644 --- a/apps/client/public/locales/zh/translation.json +++ b/apps/client/public/locales/zh/translation.json @@ -38,19 +38,5 @@ }, "home": { "Recently updated": "最近更新" - }, - "space": {}, - "page": {}, - "page-history": { - "Page history": "页面历史", - "Error loading page history.": "加载页面历史时出错。", - "No page history saved yet.": "尚未保存页面历史。", - "Please confirm your action": "请确认您的操作", - "Are you sure you want to restore this version? Any changes not versioned will be lost.": "您确定要恢复此版本吗?任何未版本化的更改将会丢失。", - "Confirm": "确认", - "Cancel": "取消", - "Successfully restored": "恢复成功", - "Restore": "恢复", - "Error fetching page data.": "获取页面数据时出错。" } } diff --git a/apps/client/src/features/page-history/components/history-list.tsx b/apps/client/src/features/page-history/components/history-list.tsx index d6ab69ce..8ff9f93a 100644 --- a/apps/client/src/features/page-history/components/history-list.tsx +++ b/apps/client/src/features/page-history/components/history-list.tsx @@ -23,8 +23,7 @@ interface Props { } function HistoryList({ pageId }: Props) { - const { t } = useTranslation("translation", { keyPrefix: "pageHistory" }); - + const { t } = useTranslation("page"); const [activeHistoryId, setActiveHistoryId] = useAtom(activeHistoryIdAtom); const { data: pageHistoryList, diff --git a/apps/client/src/features/page-history/components/history-modal.tsx b/apps/client/src/features/page-history/components/history-modal.tsx index 3172c374..8a4ef081 100644 --- a/apps/client/src/features/page-history/components/history-modal.tsx +++ b/apps/client/src/features/page-history/components/history-modal.tsx @@ -8,7 +8,7 @@ interface Props { pageId: string; } export default function HistoryModal({ pageId }: Props) { - const { t } = useTranslation("translation", { keyPrefix: "pageHistory" }); + const { t } = useTranslation("page"); const [isModalOpen, setModalOpen] = useAtom(historyAtoms); return ( diff --git a/apps/client/src/features/page-history/components/history-view.tsx b/apps/client/src/features/page-history/components/history-view.tsx index bec6fd09..d8a4850b 100644 --- a/apps/client/src/features/page-history/components/history-view.tsx +++ b/apps/client/src/features/page-history/components/history-view.tsx @@ -7,7 +7,7 @@ interface HistoryProps { } function HistoryView({ historyId }: HistoryProps) { - const { t } = useTranslation("translation", { keyPrefix: "pageHistory" }); + const { t } = useTranslation("page"); const { data, isLoading, isError } = usePageHistoryQuery(historyId); if (isLoading) { diff --git a/apps/client/src/pages/page/page.tsx b/apps/client/src/pages/page/page.tsx index fe365dc6..18361c30 100644 --- a/apps/client/src/pages/page/page.tsx +++ b/apps/client/src/pages/page/page.tsx @@ -15,7 +15,7 @@ import { import { useTranslation } from "react-i18next"; export default function Page() { - const { t } = useTranslation("translation", { keyPrefix: "page" }); + const { t } = useTranslation("page"); const { pageSlug } = useParams(); const { data: page,