From b433a34747d7f2bed4d025145e2eec9b3fc7cb8a Mon Sep 17 00:00:00 2001 From: hailin Date: Tue, 20 May 2025 14:20:24 +0800 Subject: [PATCH] . --- apps/blogai/components/header.tsx | 10 +++++----- apps/blogai/locales/en/common.json | 18 ++++++++++++++++++ apps/blogai/locales/zh-CN/common.json | 18 ++++++++++++++++++ 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/apps/blogai/components/header.tsx b/apps/blogai/components/header.tsx index b57b4a3..b95775b 100644 --- a/apps/blogai/components/header.tsx +++ b/apps/blogai/components/header.tsx @@ -43,6 +43,7 @@ import { Trash2 } from "lucide-react"; import { useEffect } from "react"; +import { useTranslation } from "react-i18next"; import { BadgeInfo, @@ -417,6 +418,8 @@ export function DetailPageHeader({ data }: { data: any }) { const [canDeploy, setCanDeploy] = useState(true); const socketRef = useRef(null); + const { t } = useTranslation(); + const initWebSocket = (userName: string, id: number) => { if (socketRef.current) socketRef.current.close(); @@ -607,10 +610,10 @@ export function DetailPageHeader({ data }: { data: any }) { setCanDeploy(false); // ✅ 已部署/已停止,不允许再次 deploy if (status === "running") { - setStatusText("运行中"); + setStatusText(t("status.running")); setProgressBarColor("bg-green-500"); } else if (status === "stopped") { - setStatusText("已停止"); + setStatusText(t("status.stopped")); setProgressBarColor("bg-gray-400"); } } else { @@ -780,9 +783,6 @@ export function DetailPageHeader({ data }: { data: any }) { )} - - - diff --git a/apps/blogai/locales/en/common.json b/apps/blogai/locales/en/common.json index c1ba66a..3bf3980 100644 --- a/apps/blogai/locales/en/common.json +++ b/apps/blogai/locales/en/common.json @@ -67,6 +67,24 @@ "update_subscriptions": "Update subscriptions", "subscribe": "Subscribe" }, + "deploy": { + "starting": "Starting deployment...", + "running": "Running", + "stopped": "Stopped", + "not_deployed": "Not deployed yet", + "progress_prefix": "Progress", + "deleting": "Deleting deployment...", + "deletion_success": "Deleted successfully", + "deletion_failed": "Deletion failed", + "request_failed": "Request failed", + "ws_error": "WebSocket error", + "deploying": "Deploying...", + "fetching_status": "Fetching status...", + "done": "Deployment complete", + "status_prefix": "Status", + "retry": "Retry", + "loading": "Loading..." + }, "footer": { "thank_subscription": "Thank you for your subscription", "subscribe_success": "Subscription Successful", diff --git a/apps/blogai/locales/zh-CN/common.json b/apps/blogai/locales/zh-CN/common.json index cad5fe3..56a1798 100644 --- a/apps/blogai/locales/zh-CN/common.json +++ b/apps/blogai/locales/zh-CN/common.json @@ -67,6 +67,24 @@ "update_subscriptions": "更新订阅", "subscribe": "订阅" }, + "deploy": { + "starting": "正在启动部署...", + "running": "运行中", + "stopped": "已停止", + "not_deployed": "尚未部署", + "progress_prefix": "进度", + "deleting": "正在删除部署...", + "deletion_success": "删除成功", + "deletion_failed": "删除失败", + "request_failed": "请求失败", + "ws_error": "WebSocket 出错", + "deploying": "部署中...", + "fetching_status": "正在拉取状态...", + "done": "部署完成", + "status_prefix": "状态", + "retry": "重试", + "loading": "加载中..." + }, "footer": { "thank_subscription": "感谢您的订阅", "subscribe_success": "订阅成功",