mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-12 13:51:12 +03:00
Miscellaneous fixes (0.17 Beta) (#21443)
* Use thread lock for JinaV2 call as it sets multiple internal fields while being called * fix audio label translation in explore filter * Show event in all cases, even without non-none match * improve i18n key fallback when translation files aren't loaded just display a valid time now instead of "invalid time" --------- Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
This commit is contained in:
co-authored by
Josh Hawkins
parent
3655b9269d
commit
e2a1208c90
@@ -79,6 +79,24 @@ i18n
|
||||
parseMissingKeyHandler: (key: string) => {
|
||||
const parts = key.split(".");
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`Missing translation key: ${key}`);
|
||||
|
||||
if (parts[0] === "time" && parts[1]?.includes("formattedTimestamp")) {
|
||||
// Extract the format type from the last part (12hour, 24hour)
|
||||
const formatType = parts[parts.length - 1];
|
||||
|
||||
// Return actual date-fns format strings as fallbacks
|
||||
const formatDefaults: Record<string, string> = {
|
||||
"12hour": "h:mm aaa",
|
||||
"24hour": "HH:mm",
|
||||
};
|
||||
|
||||
if (formatDefaults[formatType]) {
|
||||
return formatDefaults[formatType];
|
||||
}
|
||||
}
|
||||
|
||||
// Handle special cases for objects and audio
|
||||
if (parts[0] === "object" || parts[0] === "audio") {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user