mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-28 19:18:22 +03:00
add config groups as a separate i18n namespace
This commit is contained in:
parent
3fc07e507a
commit
aad24497bf
@ -1,10 +1,6 @@
|
|||||||
{
|
{
|
||||||
"label": "Audio events",
|
"label": "Audio events",
|
||||||
"description": "settings for audio-based event detection; camera-level settings can override these.",
|
"description": "settings for audio-based event detection; camera-level settings can override these.",
|
||||||
"groups": {
|
|
||||||
"detection": "Detection",
|
|
||||||
"sensitivity": "Sensitivity"
|
|
||||||
},
|
|
||||||
"enabled": {
|
"enabled": {
|
||||||
"label": "Enable audio events",
|
"label": "Enable audio events",
|
||||||
"description": "Enable or disable audio event detection globally. Can be overridden per camera."
|
"description": "Enable or disable audio event detection globally. Can be overridden per camera."
|
||||||
|
|||||||
@ -1,10 +1,6 @@
|
|||||||
{
|
{
|
||||||
"label": "Object Detection",
|
"label": "Object Detection",
|
||||||
"description": "Settings for the detection/detect role used to run object detection and initialize trackers.",
|
"description": "Settings for the detection/detect role used to run object detection and initialize trackers.",
|
||||||
"groups": {
|
|
||||||
"resolution": "Resolution",
|
|
||||||
"tracking": "Tracking"
|
|
||||||
},
|
|
||||||
"enabled": {
|
"enabled": {
|
||||||
"label": "Detection Enabled",
|
"label": "Detection Enabled",
|
||||||
"description": "Enable or disable object detection for this camera. Detection must be enabled for object tracking to run."
|
"description": "Enable or disable object detection for this camera. Detection must be enabled for object tracking to run."
|
||||||
|
|||||||
28
web/public/locales/en/config/groups.json
Normal file
28
web/public/locales/en/config/groups.json
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"audio": {
|
||||||
|
"detection": "Detection",
|
||||||
|
"sensitivity": "Sensitivity"
|
||||||
|
},
|
||||||
|
"timestamp_style": {
|
||||||
|
"appearance": "Appearance"
|
||||||
|
},
|
||||||
|
"motion": {
|
||||||
|
"sensitivity": "Sensitivity",
|
||||||
|
"algorithm": "Algorithm"
|
||||||
|
},
|
||||||
|
"snapshots": {
|
||||||
|
"display": "Display"
|
||||||
|
},
|
||||||
|
"detect": {
|
||||||
|
"resolution": "Resolution",
|
||||||
|
"tracking": "Tracking"
|
||||||
|
},
|
||||||
|
"objects": {
|
||||||
|
"tracking": "Tracking",
|
||||||
|
"filtering": "Filtering"
|
||||||
|
},
|
||||||
|
"record": {
|
||||||
|
"retention": "Retention",
|
||||||
|
"events": "Events"
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,10 +1,6 @@
|
|||||||
{
|
{
|
||||||
"label": "Motion detection",
|
"label": "Motion detection",
|
||||||
"description": "Default motion detection settings applied to cameras unless overridden per-camera.",
|
"description": "Default motion detection settings applied to cameras unless overridden per-camera.",
|
||||||
"groups": {
|
|
||||||
"sensitivity": "Sensitivity",
|
|
||||||
"algorithm": "Algorithm"
|
|
||||||
},
|
|
||||||
"enabled": {
|
"enabled": {
|
||||||
"label": "Enable motion detection",
|
"label": "Enable motion detection",
|
||||||
"description": "Enable or disable motion detection globally; per-camera settings can override this."
|
"description": "Enable or disable motion detection globally; per-camera settings can override this."
|
||||||
|
|||||||
@ -1,10 +1,6 @@
|
|||||||
{
|
{
|
||||||
"label": "Objects",
|
"label": "Objects",
|
||||||
"description": "Object tracking defaults including which labels to track and per-object filters.",
|
"description": "Object tracking defaults including which labels to track and per-object filters.",
|
||||||
"groups": {
|
|
||||||
"tracking": "Tracking",
|
|
||||||
"filtering": "Filtering"
|
|
||||||
},
|
|
||||||
"track": {
|
"track": {
|
||||||
"label": "Objects to track",
|
"label": "Objects to track",
|
||||||
"description": "List of object labels to track globally; camera configs can override this."
|
"description": "List of object labels to track globally; camera configs can override this."
|
||||||
|
|||||||
@ -1,10 +1,6 @@
|
|||||||
{
|
{
|
||||||
"label": "Recording",
|
"label": "Recording",
|
||||||
"description": "Recording and retention settings applied to cameras unless overridden per-camera.",
|
"description": "Recording and retention settings applied to cameras unless overridden per-camera.",
|
||||||
"groups": {
|
|
||||||
"retention": "Retention",
|
|
||||||
"events": "Events"
|
|
||||||
},
|
|
||||||
"enabled": {
|
"enabled": {
|
||||||
"label": "Enable record on all cameras",
|
"label": "Enable record on all cameras",
|
||||||
"description": "Enable or disable recording globally; individual cameras can override this."
|
"description": "Enable or disable recording globally; individual cameras can override this."
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
{
|
{
|
||||||
"label": "Snapshots",
|
"label": "Snapshots",
|
||||||
"description": "Settings for saved JPEG snapshots of tracked objects; can be overridden per-camera.",
|
"description": "Settings for saved JPEG snapshots of tracked objects; can be overridden per-camera.",
|
||||||
"groups": {
|
|
||||||
"display": "Display"
|
|
||||||
},
|
|
||||||
"enabled": {
|
"enabled": {
|
||||||
"label": "Snapshots enabled",
|
"label": "Snapshots enabled",
|
||||||
"description": "Enable or disable saving snapshots globally."
|
"description": "Enable or disable saving snapshots globally."
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
{
|
{
|
||||||
"label": "Timestamp style",
|
"label": "Timestamp style",
|
||||||
"description": "Styling options for in-feed timestamps applied to recordings and snapshots.",
|
"description": "Styling options for in-feed timestamps applied to recordings and snapshots.",
|
||||||
"groups": {
|
|
||||||
"appearance": "Appearance"
|
|
||||||
},
|
|
||||||
"position": {
|
"position": {
|
||||||
"label": "Timestamp position",
|
"label": "Timestamp position",
|
||||||
"description": "Position of the timestamp on the image (tl/tr/bl/br)."
|
"description": "Position of the timestamp on the image (tl/tr/bl/br)."
|
||||||
|
|||||||
@ -30,7 +30,18 @@ export function ObjectFieldTemplate(props: ObjectFieldTemplateProps) {
|
|||||||
|
|
||||||
const [isOpen, setIsOpen] = useState(true);
|
const [isOpen, setIsOpen] = useState(true);
|
||||||
|
|
||||||
const { t } = useTranslation([formContext?.i18nNamespace || "common"]);
|
const { t } = useTranslation([
|
||||||
|
formContext?.i18nNamespace || "common",
|
||||||
|
"config/groups",
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Extract domain from i18nNamespace (e.g., "config/audio" -> "audio")
|
||||||
|
const getDomainFromNamespace = (ns?: string): string => {
|
||||||
|
if (!ns || !ns.startsWith("config/")) return "";
|
||||||
|
return ns.replace("config/", "");
|
||||||
|
};
|
||||||
|
|
||||||
|
const domain = getDomainFromNamespace(formContext?.i18nNamespace);
|
||||||
|
|
||||||
const groupDefinitions =
|
const groupDefinitions =
|
||||||
(uiSchema?.["ui:groups"] as Record<string, string[]> | undefined) || {};
|
(uiSchema?.["ui:groups"] as Record<string, string[]> | undefined) || {};
|
||||||
@ -120,7 +131,12 @@ export function ObjectFieldTemplate(props: ObjectFieldTemplateProps) {
|
|||||||
|
|
||||||
ordered.forEach((item) => grouped.add(item.name));
|
ordered.forEach((item) => grouped.add(item.name));
|
||||||
|
|
||||||
const label = t(`groups.${groupKey}`, {
|
const label = domain
|
||||||
|
? t(`${domain}.${groupKey}`, {
|
||||||
|
ns: "config/groups",
|
||||||
|
defaultValue: toTitle(groupKey),
|
||||||
|
})
|
||||||
|
: t(`groups.${groupKey}`, {
|
||||||
defaultValue: toTitle(groupKey),
|
defaultValue: toTitle(groupKey),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -73,6 +73,7 @@ i18n
|
|||||||
"config/face_recognition",
|
"config/face_recognition",
|
||||||
"config/lpr",
|
"config/lpr",
|
||||||
"config/validation",
|
"config/validation",
|
||||||
|
"config/groups",
|
||||||
],
|
],
|
||||||
defaultNS: "common",
|
defaultNS: "common",
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user