From 52b1c7fbda445e9a9eed90c1783a60ea78dcd788 Mon Sep 17 00:00:00 2001 From: ZhaiSoul <842607283@qq.com> Date: Sun, 16 Mar 2025 20:28:55 +0800 Subject: [PATCH] chore: add some missing i18n keys --- web/public/locales/en/views/live.json | 5 +++++ web/public/locales/en/views/system.json | 5 ++++- web/public/locales/zh-CN/components/filter.json | 2 +- web/public/locales/zh-CN/views/live.json | 7 ++++++- web/public/locales/zh-CN/views/system.json | 5 ++++- web/src/views/live/DraggableGridLayout.tsx | 11 ++++++++--- web/src/views/system/CameraMetrics.tsx | 4 +++- 7 files changed, 31 insertions(+), 8 deletions(-) diff --git a/web/public/locales/en/views/live.json b/web/public/locales/en/views/live.json index 41ac714b7..0c31d4833 100644 --- a/web/public/locales/en/views/live.json +++ b/web/public/locales/en/views/live.json @@ -145,5 +145,10 @@ "active_objects": "Active Objects" }, "notAllTips": "Your {{source}} recording retention configuration is set to mode: {{effectiveRetainMode}}, so this on-demand recording will only keep segments with {{effectiveRetainModeName}}." + }, + "editLayout": { + "label": "Edit Layout", + "group.label": "Edit Camera Group", + "exitEdit": "Exit Editing" } } diff --git a/web/public/locales/en/views/system.json b/web/public/locales/en/views/system.json index 47fcd423f..cbcf80995 100644 --- a/web/public/locales/en/views/system.json +++ b/web/public/locales/en/views/system.json @@ -109,7 +109,10 @@ "fps": "FPS:", "unknown": "Unknown", "audio": "Audio:", - "error": "Error: {{error}}" + "error": "Error: {{error}}", + "tips": { + "title": "Camera Probe Info" + } }, "framesAndDetections": "Frames / Detections", "label": { diff --git a/web/public/locales/zh-CN/components/filter.json b/web/public/locales/zh-CN/components/filter.json index f7c7deffe..62ebf5093 100644 --- a/web/public/locales/zh-CN/components/filter.json +++ b/web/public/locales/zh-CN/components/filter.json @@ -104,5 +104,5 @@ "placeholder": "输入以搜索车牌...", "noLicensePlatesFound": "未找到车牌。", "selectPlatesFromList": "从列表中选择一个或多个车牌。" -} + } } diff --git a/web/public/locales/zh-CN/views/live.json b/web/public/locales/zh-CN/views/live.json index a23ab26ca..95b0797b9 100644 --- a/web/public/locales/zh-CN/views/live.json +++ b/web/public/locales/zh-CN/views/live.json @@ -145,5 +145,10 @@ "active_objects": "活动对象" }, "notAllTips": "您的 {{source}} 录制保留配置设置为 mode: {{effectiveRetainMode}},因此此按需录制将仅保留包含 {{effectiveRetainModeName}} 的片段。" - } + }, + "editLayout": { + "label": "编辑布局", + "group.label": "编辑摄像机分组", + "exitEdit": "退出编辑" +} } diff --git a/web/public/locales/zh-CN/views/system.json b/web/public/locales/zh-CN/views/system.json index e123d1880..548818ac2 100644 --- a/web/public/locales/zh-CN/views/system.json +++ b/web/public/locales/zh-CN/views/system.json @@ -109,7 +109,10 @@ "fps": "帧率:", "unknown": "未知", "audio": "音频:", - "error": "错误:{{error}}" + "error": "错误:{{error}}", + "tips": { + "title": "摄像头信息" + } }, "framesAndDetections": "帧数/检测次数", "label": { diff --git a/web/src/views/live/DraggableGridLayout.tsx b/web/src/views/live/DraggableGridLayout.tsx index 6f3a16df5..2fc21357d 100644 --- a/web/src/views/live/DraggableGridLayout.tsx +++ b/web/src/views/live/DraggableGridLayout.tsx @@ -48,9 +48,9 @@ import { } from "@/components/ui/tooltip"; import { Toaster } from "@/components/ui/sonner"; import useCameraLiveMode from "@/hooks/use-camera-live-mode"; -import { t } from "i18next"; import LiveContextMenu from "@/components/menu/LiveContextMenu"; import { useStreamingSettings } from "@/context/streaming-settings-provider"; +import { useTranslation } from "react-i18next"; type DraggableGridLayoutProps = { cameras: CameraConfig[]; @@ -80,6 +80,7 @@ export default function DraggableGridLayout({ fullscreen, toggleFullscreen, }: DraggableGridLayoutProps) { + const { t } = useTranslation(["views/live"]); const { data: config } = useSWR("config"); const birdseyeConfig = useMemo(() => config?.birdseye, [config]); @@ -659,7 +660,9 @@ export default function DraggableGridLayout({ - {isEditMode ? "Exit Editing" : "Edit Layout"} + {isEditMode + ? t("editLayout.exitEdit") + : t("editLayout.label")} {!isEditMode && ( @@ -677,7 +680,9 @@ export default function DraggableGridLayout({ - {isEditMode ? "Exit Editing" : "Edit Camera Group"} + {isEditMode + ? t("editLayout.exitEdit") + : t("editLayout.group.label")} )} diff --git a/web/src/views/system/CameraMetrics.tsx b/web/src/views/system/CameraMetrics.tsx index 19e5132df..497e6f435 100644 --- a/web/src/views/system/CameraMetrics.tsx +++ b/web/src/views/system/CameraMetrics.tsx @@ -272,7 +272,9 @@ export default function CameraMetrics({ }} /> - Camera Probe Info + + {t("cameras.info.tips.title")} +