i18n miscellaneous fixes (#21614)

* 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
4 changed files with 12 additions and 8 deletions

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;