I18N Miscellaneous Fixes (#21573)

* fix: fix classification none tag i18n wrong

* fix: fix set password dialog jwt time i18n wrong

* fix: fix wizard other camera i18n

* fix: fix explore tracking detail audio i18n

* feat: add system processes info i18n

* fix: fix live page label i18n
This commit is contained in:
GuoQing Liu
2026-01-09 05:28:18 +08:00
committed by GitHub
parent 74d14cb8ca
commit f3543cfee2
10 changed files with 49 additions and 26 deletions

View File

@@ -1,5 +1,5 @@
import { fromUnixTime, intervalToDuration, formatDuration } from "date-fns";
import { Locale } from "date-fns/locale";
import { enUS, Locale } from "date-fns/locale";
import { formatInTimeZone } from "date-fns-tz";
import i18n from "@/utils/i18n";
export const longToDate = (long: number): Date => new Date(long * 1000);
@@ -293,9 +293,13 @@ export const getDurationFromTimestamps = (
/**
*
* @param seconds - number of seconds to convert into hours, minutes and seconds
* @param locale - the date-fns locale to use for formatting
* @returns string - formatted duration in hours, minutes and seconds
*/
export const formatSecondsToDuration = (seconds: number): string => {
export const formatSecondsToDuration = (
seconds: number,
locale?: Locale,
): string => {
if (isNaN(seconds) || seconds < 0) {
return "Invalid duration";
}
@@ -304,6 +308,7 @@ export const formatSecondsToDuration = (seconds: number): string => {
return formatDuration(duration, {
format: ["hours", "minutes", "seconds"],
delimiter: ", ",
locale: locale ?? enUS,
});
};

View File

@@ -12,7 +12,10 @@ export function getLifecycleItemDescription(
const label = lifecycleItem.data.sub_label
? capitalizeFirstLetter(rawLabel)
: getTranslatedLabel(rawLabel);
: getTranslatedLabel(
rawLabel,
lifecycleItem.class_type === "heard" ? "audio" : "object",
);
switch (lifecycleItem.class_type) {
case "visible":