From c8e22a365344fe81212b40cc24569e5b2a48515b Mon Sep 17 00:00:00 2001 From: GuoQing Liu <842607283@qq.com> Date: Sat, 19 Apr 2025 22:02:15 +0800 Subject: [PATCH] Fix some page i18n wrong (#17682) * fix: some pages can't translation object label. * revert: revert wrong label fix * feat: add openai base_url setting * fix: fix classification modelSize i18n error * revert: revert openai base_url setting * fix: fix enrichments pages i18n keys wrong * fix: fix mobile bottom bar reindexing embeddings i18n wrong * feat: add more system stats i18n keys * fix: fix review filter objects i18n * chore: remove frigate+ label i18n --- web/public/locales/en/views/explore.json | 7 ++++++- web/public/locales/en/views/system.json | 6 +++++- web/src/components/filter/ReviewFilterGroup.tsx | 2 +- web/src/components/filter/SearchFilterGroup.tsx | 4 +++- web/src/components/input/InputWithTags.tsx | 10 ++++++++-- web/src/components/navigation/Bottombar.tsx | 11 +++++++++-- .../components/overlay/detail/ObjectLifecycle.tsx | 10 +++++++--- .../overlay/detail/ReviewDetailDialog.tsx | 6 +++++- .../overlay/detail/SearchDetailDialog.tsx | 8 +++++--- web/src/hooks/use-stats.ts | 14 +++++++++++--- web/src/utils/lifecycleUtil.ts | 15 ++++++++++----- .../views/settings/ClassificationSettingsView.tsx | 8 ++++++-- web/src/views/settings/ObjectSettingsView.tsx | 2 +- web/src/views/system/EnrichmentMetrics.tsx | 7 +++++-- 14 files changed, 82 insertions(+), 28 deletions(-) diff --git a/web/public/locales/en/views/explore.json b/web/public/locales/en/views/explore.json index c75951f93..8831a719f 100644 --- a/web/public/locales/en/views/explore.json +++ b/web/public/locales/en/views/explore.json @@ -54,7 +54,12 @@ }, "gone": "{{label}} left", "heard": "{{label}} heard", - "external": "{{label}} detected" + "external": "{{label}} detected", + "header": { + "zones": "Zones", + "ratio": "Ratio", + "area": "Area" + } }, "annotationSettings": { "title": "Annotation Settings", diff --git a/web/public/locales/en/views/system.json b/web/public/locales/en/views/system.json index 98583134c..c57848a04 100644 --- a/web/public/locales/en/views/system.json +++ b/web/public/locales/en/views/system.json @@ -142,7 +142,10 @@ "ffmpegHighCpuUsage": "{{camera}} has high FFMPEG CPU usage ({{ffmpegAvg}}%)", "detectHighCpuUsage": "{{camera}} has high detect CPU usage ({{detectAvg}}%)", "healthy": "System is healthy", - "reindexingEmbeddings": "Reindexing embeddings ({{processed}}% complete)" + "reindexingEmbeddings": "Reindexing embeddings ({{processed}}% complete)", + "cameraIsOffline": "{{camera}} is offline", + "detectIsSlow": "{{detect}} is slow ({{speed}} ms)", + "detectIsVerySlow": "{{detect}} is very slow ({{speed}} ms)" }, "enrichments": { "title": "Enrichments", @@ -150,6 +153,7 @@ "embeddings": { "image_embedding_speed": "Image Embedding Speed", "face_embedding_speed": "Face Embedding Speed", + "face_recognition_speed": "Face Recognition Speed", "plate_recognition_speed": "Plate Recognition Speed", "text_embedding_speed": "Text Embedding Speed" } diff --git a/web/src/components/filter/ReviewFilterGroup.tsx b/web/src/components/filter/ReviewFilterGroup.tsx index eaee3ccf5..13e7b5a2a 100644 --- a/web/src/components/filter/ReviewFilterGroup.tsx +++ b/web/src/components/filter/ReviewFilterGroup.tsx @@ -498,7 +498,7 @@ export function GeneralFilterContent({ {allLabels.map((item) => ( { if (isChecked) { diff --git a/web/src/components/filter/SearchFilterGroup.tsx b/web/src/components/filter/SearchFilterGroup.tsx index a35ca145e..9f57adf6c 100644 --- a/web/src/components/filter/SearchFilterGroup.tsx +++ b/web/src/components/filter/SearchFilterGroup.tsx @@ -263,7 +263,9 @@ function GeneralFilterButton({ } if (selectedLabels.length == 1) { - return t(selectedLabels[0], { ns: "objects" }); + return t(selectedLabels[0], { + ns: "objects", + }); } return t("labels.count", { diff --git a/web/src/components/input/InputWithTags.tsx b/web/src/components/input/InputWithTags.tsx index 4c5e9ab8b..5da76c502 100644 --- a/web/src/components/input/InputWithTags.tsx +++ b/web/src/components/input/InputWithTags.tsx @@ -419,7 +419,9 @@ export default function InputWithTags({ ? t("button.yes", { ns: "common" }) : t("button.no", { ns: "common" }); } else if (filterType === "labels") { - return t(filterValues as string, { ns: "objects" }); + return t(filterValues as string, { + ns: "objects", + }); } else if (filterType === "search_type") { return t("filter.searchType." + (filterValues as string)); } else { @@ -817,7 +819,11 @@ export default function InputWithTags({ className="inline-flex items-center whitespace-nowrap rounded-full bg-green-100 px-2 py-0.5 text-sm capitalize text-green-800" > {t("filter.label." + filterType)}:{" "} - {value.replaceAll("_", " ")} + {filterType === "labels" + ? t(value, { + ns: "objects", + }) + : value.replaceAll("_", " ")}