mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-05 04:57:42 +03:00
change submit to plus to use a question with yes/no
This commit is contained in:
parent
c7e9b72949
commit
c0ce0c1587
@ -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."
|
"desc": "Objects in locations you want to avoid are not false positives. Submitting them as false positives will confuse the model."
|
||||||
},
|
},
|
||||||
"review": {
|
"review": {
|
||||||
"true": {
|
"question": {
|
||||||
"label": "Confirm this label for Frigate Plus",
|
"label": "Confirm this label for Frigate Plus",
|
||||||
"true_one": "This is a {{label}}",
|
"ask_a": "Is this object a <code>{{label}}</code>?",
|
||||||
"true_other": "This is an {{label}}"
|
"ask_an": "Is this object an <code>{{label}}</code>?",
|
||||||
},
|
"ask_full": "Is this object a <code>{{untranslatedLabel}}</code> ({{translatedLabel}})?"
|
||||||
"false": {
|
|
||||||
"label": "Do not confirm this label for Frigate Plus",
|
|
||||||
"false_one": "This is not a {{label}}",
|
|
||||||
"false_other": "This is not an {{label}}"
|
|
||||||
},
|
},
|
||||||
"state": {
|
"state": {
|
||||||
"submitted": "Submitted"
|
"submitted": "Submitted"
|
||||||
|
|||||||
@ -73,7 +73,7 @@ import { LuInfo, LuSearch } from "react-icons/lu";
|
|||||||
import { TooltipPortal } from "@radix-ui/react-tooltip";
|
import { TooltipPortal } from "@radix-ui/react-tooltip";
|
||||||
import { FaPencilAlt } from "react-icons/fa";
|
import { FaPencilAlt } from "react-icons/fa";
|
||||||
import TextEntryDialog from "@/components/overlay/dialog/TextEntryDialog";
|
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 { TbFaceId } from "react-icons/tb";
|
||||||
import { useIsAdmin } from "@/hooks/use-is-admin";
|
import { useIsAdmin } from "@/hooks/use-is-admin";
|
||||||
import FaceSelectionDialog from "../FaceSelectionDialog";
|
import FaceSelectionDialog from "../FaceSelectionDialog";
|
||||||
@ -1017,7 +1017,7 @@ export function ObjectSnapshotTab({
|
|||||||
search,
|
search,
|
||||||
onEventUploaded,
|
onEventUploaded,
|
||||||
}: ObjectSnapshotTabProps) {
|
}: ObjectSnapshotTabProps) {
|
||||||
const { t } = useTranslation(["components/dialog"]);
|
const { t, i18n } = useTranslation(["components/dialog"]);
|
||||||
type SubmissionState = "reviewing" | "uploading" | "submitted";
|
type SubmissionState = "reviewing" | "uploading" | "submitted";
|
||||||
|
|
||||||
const [imgRef, imgLoaded, onImgLoad] = useImageLoaded();
|
const [imgRef, imgLoaded, onImgLoad] = useImageLoaded();
|
||||||
@ -1128,42 +1128,67 @@ export function ObjectSnapshotTab({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex flex-row justify-center gap-2 md:justify-end">
|
<div className="flex w-full flex-1 flex-col justify-center gap-2 md:ml-8 md:w-auto md:justify-end">
|
||||||
{state == "reviewing" && (
|
{state == "reviewing" && (
|
||||||
<>
|
<>
|
||||||
|
<div>
|
||||||
|
{i18n.language === "en" ? (
|
||||||
|
// English with a/an logic plus label
|
||||||
|
<>
|
||||||
|
{/^[aeiou]/i.test(search?.label || "") ? (
|
||||||
|
<Trans
|
||||||
|
ns="components/dialog"
|
||||||
|
values={{ label: search?.label }}
|
||||||
|
>
|
||||||
|
explore.plus.review.question.ask_an
|
||||||
|
</Trans>
|
||||||
|
) : (
|
||||||
|
<Trans
|
||||||
|
ns="components/dialog"
|
||||||
|
values={{ label: search?.label }}
|
||||||
|
>
|
||||||
|
explore.plus.review.question.ask_a
|
||||||
|
</Trans>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
// For other languages
|
||||||
|
<Trans
|
||||||
|
ns="components/dialog"
|
||||||
|
values={{
|
||||||
|
untranslatedLabel: search?.label,
|
||||||
|
translatedLabel: t(
|
||||||
|
"filter.label." + search?.label,
|
||||||
|
),
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
explore.plus.review.question.ask_full
|
||||||
|
</Trans>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="flex w-full flex-row gap-2">
|
||||||
<Button
|
<Button
|
||||||
className="bg-success"
|
className="flex-1 bg-success"
|
||||||
aria-label={t("explore.plus.review.true.label")}
|
aria-label={t("button.yes", { ns: "common" })}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setState("uploading");
|
setState("uploading");
|
||||||
onSubmitToPlus(false);
|
onSubmitToPlus(false);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/^[aeiou]/i.test(search?.label || "")
|
{t("button.yes", { ns: "common" })}
|
||||||
? t("explore.plus.review.true.true_other", {
|
|
||||||
label: search?.label,
|
|
||||||
})
|
|
||||||
: t("explore.plus.review.true.true_one", {
|
|
||||||
label: search?.label,
|
|
||||||
})}
|
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
className="text-white"
|
className="flex-1 text-white"
|
||||||
aria-label={t("explore.plus.review.false.label")}
|
aria-label={t("button.no", { ns: "common" })}
|
||||||
variant="destructive"
|
variant="destructive"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setState("uploading");
|
setState("uploading");
|
||||||
onSubmitToPlus(true);
|
onSubmitToPlus(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/^[aeiou]/i.test(search?.label || "")
|
{t("button.no", { ns: "common" })}
|
||||||
? t("explore.plus.review.false.false_other", {
|
|
||||||
label: search?.label,
|
|
||||||
})
|
|
||||||
: t("explore.plus.review.false.false_one", {
|
|
||||||
label: search?.label,
|
|
||||||
})}
|
|
||||||
</Button>
|
</Button>
|
||||||
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{state == "uploading" && <ActivityIndicator />}
|
{state == "uploading" && <ActivityIndicator />}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user