mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-20 13:54:36 +01:00
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:
@@ -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,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user