* 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:
Josh Hawkins
2025-06-25 16:45:24 -05:00
committed by GitHub
parent 623bc72633
commit f97629433d
14 changed files with 45 additions and 30 deletions

View File

@@ -12,7 +12,7 @@ import { SearchResult } from "@/types/search";
import { cn } from "@/lib/utils";
import { TooltipPortal } from "@radix-ui/react-tooltip";
import useContextMenu from "@/hooks/use-contextmenu";
import { useTranslation } from "react-i18next";
import { getTranslatedLabel } from "@/utils/i18n";
type SearchThumbnailProps = {
searchResult: SearchResult;
@@ -23,7 +23,6 @@ export default function SearchThumbnail({
searchResult,
onClick,
}: SearchThumbnailProps) {
const { t } = useTranslation(["views/search"]);
const apiHost = useApiHost();
const { data: config } = useSWR<FrigateConfig>("config");
const [imgRef, imgLoaded, onImgLoad] = useImageLoaded();
@@ -151,7 +150,7 @@ export default function SearchThumbnail({
.filter(
(item) => item !== undefined && !item.includes("-verified"),
)
.map((text) => t(text, { ns: "objects" }))
.map((text) => getTranslatedLabel(text))
.sort()
.join(", ")
.replaceAll("-verified", "")}

View File

@@ -24,6 +24,7 @@ import CalendarFilterButton from "./CalendarFilterButton";
import { CamerasFilterButton } from "./CamerasFilterButton";
import PlatformAwareDialog from "../overlay/dialog/PlatformAwareDialog";
import { useTranslation } from "react-i18next";
import { getTranslatedLabel } from "@/utils/i18n";
const REVIEW_FILTERS = [
"cameras",
@@ -498,7 +499,7 @@ export function GeneralFilterContent({
{allLabels.map((item) => (
<FilterSwitch
key={item}
label={t(item, { ns: "objects" })}
label={getTranslatedLabel(item)}
isChecked={filter.labels?.includes(item) ?? false}
onCheckedChange={(isChecked) => {
if (isChecked) {

View File

@@ -26,6 +26,7 @@ import { CalendarRangeFilterButton } from "./CalendarFilterButton";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
import { useTranslation } from "react-i18next";
import { getTranslatedLabel } from "@/utils/i18n";
type SearchFilterGroupProps = {
className: string;
@@ -372,7 +373,7 @@ export function GeneralFilterContent({
{allLabels.map((item) => (
<FilterSwitch
key={item}
label={t(item, { ns: "objects" })}
label={getTranslatedLabel(item)}
isChecked={currentLabels?.includes(item) ?? false}
onCheckedChange={(isChecked) => {
if (isChecked) {

View File

@@ -38,6 +38,7 @@ import { toast } from "sonner";
import { Toaster } from "../ui/sonner";
import ActivityIndicator from "../indicators/activity-indicator";
import { useTranslation } from "react-i18next";
import { getTranslatedLabel } from "@/utils/i18n";
type ObjectMaskEditPaneProps = {
polygons?: Polygon[];
@@ -101,7 +102,7 @@ export default function ObjectMaskEditPane({
return t("masksAndZones.objectMaskLabel", {
number: count + 1,
label: t(objectType, { ns: "objects" }),
label: getTranslatedLabel(objectType),
});
}, [polygons, polygon, t]);
@@ -438,7 +439,7 @@ export function ZoneObjectSelector({ camera }: ZoneObjectSelectorProps) {
<SelectSeparator className="bg-secondary" />
{allLabels.map((item) => (
<SelectItem key={item} value={item}>
{t(item, { ns: "objects" })}
{getTranslatedLabel(item)}
</SelectItem>
))}
</SelectGroup>

View File

@@ -33,6 +33,7 @@ import { Trans, useTranslation } from "react-i18next";
import { Link } from "react-router-dom";
import { LuExternalLink } from "react-icons/lu";
import { useDocDomain } from "@/hooks/use-doc-domain";
import { getTranslatedLabel } from "@/utils/i18n";
type ZoneEditPaneProps = {
polygons?: Polygon[];
@@ -969,7 +970,7 @@ export function ZoneObjectSelector({
className="w-full cursor-pointer text-primary smart-capitalize"
htmlFor={item}
>
{t(item, { ns: "objects" })}
{getTranslatedLabel(item)}
</Label>
<Switch
key={item}