Fix I18n audio labels (#20508)

* ensure i18n audio label keys are translated

don't assume they are in the objects namespace

* add missing audio labels

* Improve handling of label types

* simplify

* fixes

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
This commit is contained in:
Josh Hawkins
2025-10-15 13:02:08 -06:00
committed by GitHub
co-authored by Nicolas Mowen
parent e592c7044b
commit 75d7049b6d
6 changed files with 123 additions and 14 deletions
+12 -2
View File
@@ -100,7 +100,12 @@ export default function CameraSettingsView({
const alertsLabels = useMemo(() => {
return cameraConfig?.review.alerts.labels
? cameraConfig.review.alerts.labels
.map((label) => getTranslatedLabel(label))
.map((label) =>
getTranslatedLabel(
label,
cameraConfig?.audio?.listen?.includes(label) ? "audio" : "object",
),
)
.join(", ")
: "";
}, [cameraConfig]);
@@ -108,7 +113,12 @@ export default function CameraSettingsView({
const detectionsLabels = useMemo(() => {
return cameraConfig?.review.detections.labels
? cameraConfig.review.detections.labels
.map((label) => getTranslatedLabel(label))
.map((label) =>
getTranslatedLabel(
label,
cameraConfig?.audio?.listen?.includes(label) ? "audio" : "object",
),
)
.join(", ")
: "";
}, [cameraConfig]);