mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-07 02:18:07 +01:00
Fixes (#18877)
* Object labels with spaces should use correct i18n keys * Add Hungarian * Ensure onvif move request has a valid speed before removing When autotracking zooming is set to `disabled` (or is left out of the config), move_request["Speed"] may not exist, depending on the camera * Add another frame cache debug log
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
import i18n from "i18next";
|
||||
import i18n, { t } from "i18next";
|
||||
import { initReactI18next } from "react-i18next";
|
||||
import HttpBackend from "i18next-http-backend";
|
||||
|
||||
export const getTranslatedLabel = (label: string) => {
|
||||
if (!label) return "";
|
||||
|
||||
return t(`${label.replace(/\s+/g, "_").toLowerCase()}`, { ns: "objects" });
|
||||
};
|
||||
|
||||
i18n
|
||||
.use(initReactI18next)
|
||||
.use(HttpBackend)
|
||||
|
||||
@@ -1,20 +1,15 @@
|
||||
import { ObjectLifecycleSequence } from "@/types/timeline";
|
||||
import { t } from "i18next";
|
||||
import { getTranslatedLabel } from "./i18n";
|
||||
|
||||
export function getLifecycleItemDescription(
|
||||
lifecycleItem: ObjectLifecycleSequence,
|
||||
) {
|
||||
// can't use useTranslation here
|
||||
const label = t(
|
||||
(
|
||||
(Array.isArray(lifecycleItem.data.sub_label)
|
||||
? lifecycleItem.data.sub_label[0]
|
||||
: lifecycleItem.data.sub_label) || lifecycleItem.data.label
|
||||
)
|
||||
.replace(" ", "_")
|
||||
.toLowerCase(),
|
||||
{ ns: "objects" },
|
||||
);
|
||||
const rawLabel = Array.isArray(lifecycleItem.data.sub_label)
|
||||
? lifecycleItem.data.sub_label[0]
|
||||
: lifecycleItem.data.sub_label || lifecycleItem.data.label;
|
||||
|
||||
const label = getTranslatedLabel(rawLabel);
|
||||
|
||||
switch (lifecycleItem.class_type) {
|
||||
case "visible":
|
||||
|
||||
Reference in New Issue
Block a user