NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
i18n miscellaneous fixes (#21614)
GuoQing Liu91cc6747b6f1
diff --git a/web/src/components/card/ClassificationCard.tsx b/web/src/components/card/ClassificationCard.tsxindex ffd28a0d06..6581d109a6 100644--- a/web/src/components/card/ClassificationCard.tsx+++ b/web/src/components/card/ClassificationCard.tsx@@ -164,7 +164,7 @@ export const ClassificationCard = forwardRef<)}><div className="break-all smart-capitalize">- {data.name == "unknown"+ {data.name.toLowerCase() == "unknown"? t("details.unknown"): data.name.toLowerCase() == "none"? t("details.none")@@ -336,7 +336,7 @@ export function GroupedClassificationCard({<ContentTitle className="flex items-center gap-2 font-normal capitalize">{classifiedEvent?.label && classifiedEvent.label !== "none"? classifiedEvent.label- : t(noClassificationLabel)}+ : t(noClassificationLabel, { ns: i18nLibrary })}{classifiedEvent?.label &&classifiedEvent.label !== "none" &&classifiedEvent.score !== undefined && (diff --git a/web/src/components/overlay/chip/GenAISummaryChip.tsx b/web/src/components/overlay/chip/GenAISummaryChip.tsxindex 46fefdc676..d5f7a99690 100644--- a/web/src/components/overlay/chip/GenAISummaryChip.tsx+++ b/web/src/components/overlay/chip/GenAISummaryChip.tsx@@ -57,7 +57,7 @@ export function GenAISummaryDialog({!aiAnalysis ||(!aiAnalysis.potential_threat_level && !aiAnalysis.other_concerns)) {- return "None";+ return t("label.none", { ns: "common" });}let concerns = "";@@ -74,7 +74,9 @@ export function GenAISummaryDialog({label = t("securityConcern", { ns: "views/events" });break;default:- label = THREAT_LEVEL_LABELS[threatLevel as ThreatLevel] || "Unknown";+ label =+ THREAT_LEVEL_LABELS[threatLevel as ThreatLevel] ||+ t("details.unknown", { ns: "views/classificationModel" });}concerns = `• ${label}\n`;}@@ -83,7 +85,7 @@ export function GenAISummaryDialog({concerns += `• ${c}\n`;});- return concerns || "None";+ return concerns || t("label.none", { ns: "common" });}, [aiAnalysis, t]);// layoutdiff --git a/web/src/components/player/PreviewThumbnailPlayer.tsx b/web/src/components/player/PreviewThumbnailPlayer.tsxindex 30339599ab..517a83e7ce 100644--- a/web/src/components/player/PreviewThumbnailPlayer.tsx+++ b/web/src/components/player/PreviewThumbnailPlayer.tsx@@ -342,7 +342,9 @@ export default function PreviewThumbnailPlayer({default:return (THREAT_LEVEL_LABELS[threatLevel as ThreatLevel] ||- "Unknown"+ t("details.unknown", {+ ns: "views/classificationModel",+ }));}})()}diff --git a/web/src/utils/dateUtil.ts b/web/src/utils/dateUtil.tsindex b007a9573f..cc541214c2 100644--- a/web/src/utils/dateUtil.ts+++ b/web/src/utils/dateUtil.ts@@ -165,7 +165,7 @@ export const formatUnixTimestampToDateTime = (// Uppercase AM/PM for 12-hour formatsif (date_format.includes("a") || date_format.includes("aaa")) {formatted = formatted.replace(/am|pm/gi, (match) =>- match.toUpperCase(),+ i18n.t(`time.${match.toLowerCase()}`, { ns: "common" }).toUpperCase(),);}return formatted;@@ -217,7 +217,7 @@ export const formatUnixTimestampToDateTime = (// Uppercase AM/PM in fallbackif (options.hour12) {fallbackFormatted = fallbackFormatted.replace(/am|pm/gi, (match) =>- match.toUpperCase(),+ i18n.t(`time.${match.toLowerCase()}`, { ns: "common" }).toUpperCase(),);}return fallbackFormatted;