i18n miscellaneous fixes (#21614)
Some checks are pending
CI / AMD64 Build (push) Waiting to run
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / ARM Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions

* fix: fix face library unknown label i18n wrong

* fix: fix review genai threat level i18n

* fix: fix preview unknown label i18n

* fix: fix AM/PM i18n display issue
This commit is contained in:
GuoQing Liu 2026-01-12 23:15:27 +08:00 committed by GitHub
parent 7b5a1b7284
commit 91cc6747b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 8 deletions

View File

@ -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 && (

View File

@ -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]);
// layout

View File

@ -342,7 +342,9 @@ export default function PreviewThumbnailPlayer({
default:
return (
THREAT_LEVEL_LABELS[threatLevel as ThreatLevel] ||
"Unknown"
t("details.unknown", {
ns: "views/classificationModel",
})
);
}
})()}

View File

@ -165,7 +165,7 @@ export const formatUnixTimestampToDateTime = (
// Uppercase AM/PM for 12-hour formats
if (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 fallback
if (options.hour12) {
fallbackFormatted = fallbackFormatted.replace(/am|pm/gi, (match) =>
match.toUpperCase(),
i18n.t(`time.${match.toLowerCase()}`, { ns: "common" }).toUpperCase(),
);
}
return fallbackFormatted;