From c0ce0c15871cbd7a79746dd38e9cfd851a99dd21 Mon Sep 17 00:00:00 2001
From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
Date: Thu, 17 Apr 2025 08:08:20 -0500
Subject: [PATCH] change submit to plus to use a question with yes/no
---
web/public/locales/en/components/dialog.json | 12 +--
.../overlay/detail/SearchDetailDialog.tsx | 97 ++++++++++++-------
2 files changed, 65 insertions(+), 44 deletions(-)
diff --git a/web/public/locales/en/components/dialog.json b/web/public/locales/en/components/dialog.json
index 5d185d2890..a18d20bafc 100644
--- a/web/public/locales/en/components/dialog.json
+++ b/web/public/locales/en/components/dialog.json
@@ -15,15 +15,11 @@
"desc": "Objects in locations you want to avoid are not false positives. Submitting them as false positives will confuse the model."
},
"review": {
- "true": {
+ "question": {
"label": "Confirm this label for Frigate Plus",
- "true_one": "This is a {{label}}",
- "true_other": "This is an {{label}}"
- },
- "false": {
- "label": "Do not confirm this label for Frigate Plus",
- "false_one": "This is not a {{label}}",
- "false_other": "This is not an {{label}}"
+ "ask_a": "Is this object a {{label}}?",
+ "ask_an": "Is this object an {{label}}?",
+ "ask_full": "Is this object a {{untranslatedLabel}} ({{translatedLabel}})?"
},
"state": {
"submitted": "Submitted"
diff --git a/web/src/components/overlay/detail/SearchDetailDialog.tsx b/web/src/components/overlay/detail/SearchDetailDialog.tsx
index 72cb0f8267..7c59f01cb9 100644
--- a/web/src/components/overlay/detail/SearchDetailDialog.tsx
+++ b/web/src/components/overlay/detail/SearchDetailDialog.tsx
@@ -73,7 +73,7 @@ import { LuInfo, LuSearch } from "react-icons/lu";
import { TooltipPortal } from "@radix-ui/react-tooltip";
import { FaPencilAlt } from "react-icons/fa";
import TextEntryDialog from "@/components/overlay/dialog/TextEntryDialog";
-import { useTranslation } from "react-i18next";
+import { Trans, useTranslation } from "react-i18next";
import { TbFaceId } from "react-icons/tb";
import { useIsAdmin } from "@/hooks/use-is-admin";
import FaceSelectionDialog from "../FaceSelectionDialog";
@@ -1017,7 +1017,7 @@ export function ObjectSnapshotTab({
search,
onEventUploaded,
}: ObjectSnapshotTabProps) {
- const { t } = useTranslation(["components/dialog"]);
+ const { t, i18n } = useTranslation(["components/dialog"]);
type SubmissionState = "reviewing" | "uploading" | "submitted";
const [imgRef, imgLoaded, onImgLoad] = useImageLoaded();
@@ -1128,42 +1128,67 @@ export function ObjectSnapshotTab({
-