From 5ed2e15172701820fcef85ffa24aff886d744507 Mon Sep 17 00:00:00 2001 From: jon Date: Sun, 1 Mar 2026 21:16:05 -0600 Subject: [PATCH] fix: add i18n keys, lazy logging, and improve tests per contributor guide - Add storage.breakdown.* i18n keys to en/views/system.json locale file and remove inline fallback strings from t() calls - Use lazy logging format (%s) instead of f-string in new debug log line - Rewrite retain_policy tests to target RecordConfig directly, avoiding Docker-only dependencies (labelmap, /config, detector runtimes) - Add enum value and serialization roundtrip tests --- frigate/record/cleanup.py | 3 ++- web/public/locales/en/views/system.json | 5 +++++ web/src/views/system/StorageMetrics.tsx | 15 +++------------ 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/frigate/record/cleanup.py b/frigate/record/cleanup.py index bcced9bb6..9b11d3e4f 100644 --- a/frigate/record/cleanup.py +++ b/frigate/record/cleanup.py @@ -356,7 +356,8 @@ class RecordingCleanup(threading.Thread): # StorageMaintainer handles space reclamation by deleting oldest recordings. if is_rollover: logger.debug( - f"Skipping time-based expiry for {camera} (continuous_rollover mode)." + "Skipping time-based expiry for %s (continuous_rollover mode).", + camera, ) else: continuous_expire_date = ( diff --git a/web/public/locales/en/views/system.json b/web/public/locales/en/views/system.json index 8ddbc03e1..384ea098e 100644 --- a/web/public/locales/en/views/system.json +++ b/web/public/locales/en/views/system.json @@ -110,6 +110,11 @@ "title": "SHM (shared memory) allocation", "warning": "The current SHM size of {{total}}MB is too small. Increase it to at least {{min_shm}}MB." }, + "breakdown": { + "overwritable": "Continuous (overwritable)", + "eventRetention": "Events (aging out)", + "protected": "Protected (indefinite)" + }, "cameraStorage": { "title": "Camera Storage", "camera": "Camera", diff --git a/web/src/views/system/StorageMetrics.tsx b/web/src/views/system/StorageMetrics.tsx index 277c8a87d..176543f94 100644 --- a/web/src/views/system/StorageMetrics.tsx +++ b/web/src/views/system/StorageMetrics.tsx @@ -138,28 +138,19 @@ export default function StorageMetrics({
- {t( - "storage.breakdown.overwritable", - "Continuous (overwritable)", - )} + {t("storage.breakdown.overwritable")} {getUnitSize(storageBreakdown.overwritable)}
- {t( - "storage.breakdown.eventRetention", - "Events (aging out)", - )} + {t("storage.breakdown.eventRetention")} {getUnitSize(storageBreakdown.event_retention)}
- {t( - "storage.breakdown.protected", - "Protected (indefinite)", - )} + {t("storage.breakdown.protected")} {getUnitSize(storageBreakdown.protected)}