diff --git a/web/public/locales/en/common.json b/web/public/locales/en/common.json index 37566117a..907ff6d36 100644 --- a/web/public/locales/en/common.json +++ b/web/public/locales/en/common.json @@ -131,6 +131,8 @@ "close": "Close", "copy": "Copy", "copiedToClipboard": "Copied to clipboard", + "shareTimestamp": "Share Timestamp", + "shareTimestampUrl": "Share Timestamp URL", "back": "Back", "history": "History", "fullscreen": "Fullscreen", diff --git a/web/public/locales/en/components/dialog.json b/web/public/locales/en/components/dialog.json index 9a6f68daf..b01745e43 100644 --- a/web/public/locales/en/components/dialog.json +++ b/web/public/locales/en/components/dialog.json @@ -99,6 +99,14 @@ } }, "recording": { + "shareTimestamp": { + "title": "Share Review Timestamp", + "description": "Share the current player position or choose a custom timestamp.", + "current": "Current Player Timestamp", + "custom": "Custom Timestamp", + "customDescription": "Pick a specific point in time to share.", + "shareTitle": "Frigate Review Timestamp: {{camera}}" + }, "confirmDelete": { "title": "Confirm Delete", "desc": { diff --git a/web/src/components/overlay/ActionsDropdown.tsx b/web/src/components/overlay/ActionsDropdown.tsx index e777e1a3d..0b71038b1 100644 --- a/web/src/components/overlay/ActionsDropdown.tsx +++ b/web/src/components/overlay/ActionsDropdown.tsx @@ -18,7 +18,7 @@ export default function ActionsDropdown({ onDebugReplayClick, onExportClick, onShareTimestampClick, -}: ActionsDropdownProps) { +}: Readonly) { const { t } = useTranslation(["components/dialog", "views/replay", "common"]); return ( @@ -40,7 +40,7 @@ export default function ActionsDropdown({ {t("menu.export", { ns: "common" })} - Share Timestamp + {t("button.shareTimestamp", { ns: "common" })} {t("title", { ns: "views/replay" })} diff --git a/web/src/components/overlay/MobileReviewSettingsDrawer.tsx b/web/src/components/overlay/MobileReviewSettingsDrawer.tsx index 9a4c07622..24b09e59f 100644 --- a/web/src/components/overlay/MobileReviewSettingsDrawer.tsx +++ b/web/src/components/overlay/MobileReviewSettingsDrawer.tsx @@ -104,6 +104,7 @@ export default function MobileReviewSettingsDrawer({ "views/recording", "components/dialog", "views/replay", + "common", ]); const navigate = useNavigate(); const [drawerMode, setDrawerMode] = useState("none"); @@ -283,14 +284,14 @@ export default function MobileReviewSettingsDrawer({ {features.includes("share-timestamp") && ( )} {features.includes("calendar") && ( diff --git a/web/src/components/overlay/ShareTimestampDialog.tsx b/web/src/components/overlay/ShareTimestampDialog.tsx index 319e93513..003796489 100644 --- a/web/src/components/overlay/ShareTimestampDialog.tsx +++ b/web/src/components/overlay/ShareTimestampDialog.tsx @@ -111,8 +111,8 @@ function ShareTimestampContent({ customTimestamp, setCustomTimestamp, onShareTimestamp, -}: ShareTimestampContentProps) { - const { t } = useTranslation(["common"]); +}: Readonly) { + const { t } = useTranslation(["common", "components/dialog"]); const { data: config } = useSWR("config"); const currentTimestampLabel = useFormattedTimestamp( currentTime, @@ -127,9 +127,13 @@ function ShareTimestampContent({ return (
-
Share Review Timestamp
+
+ {t("recording.shareTimestamp.title", { ns: "components/dialog" })} +
- Share the current player position or choose a custom timestamp. + {t("recording.shareTimestamp.description", { + ns: "components/dialog", + })}
@@ -145,7 +149,9 @@ function ShareTimestampContent({
@@ -198,7 +212,7 @@ function CustomTimestampSelector({ timestamp, setTimestamp, label, -}: CustomTimestampSelectorProps) { +}: Readonly) { const { t } = useTranslation(["common"]); const { data: config } = useSWR("config"); @@ -310,9 +324,9 @@ function CustomTimestampSelector({ : nextClock.split(":"); const nextTimestamp = new Date(displayTimestamp * 1000); nextTimestamp.setHours( - parseInt(hour), - parseInt(minute), - parseInt(second ?? "0"), + Number.parseInt(hour), + Number.parseInt(minute), + Number.parseInt(second ?? "0"), 0, ); setFromDisplayDate(nextTimestamp); diff --git a/web/src/views/recording/RecordingView.tsx b/web/src/views/recording/RecordingView.tsx index 26ab2a00b..86f664d9a 100644 --- a/web/src/views/recording/RecordingView.tsx +++ b/web/src/views/recording/RecordingView.tsx @@ -107,7 +107,7 @@ export function RecordingView({ updateFilter, refreshData, }: RecordingViewProps) { - const { t } = useTranslation(["views/events"]); + const { t } = useTranslation(["views/events", "components/dialog"]); const { data: config } = useSWR("config"); const navigate = useNavigate(); const location = useLocation(); @@ -344,9 +344,15 @@ export function RecordingView({ config?.ui.timezone, ); - shareOrCopy(reviewUrl, `Frigate Review Timestamp: ${mainCamera}`); + shareOrCopy( + reviewUrl, + t("recording.shareTimestamp.shareTitle", { + ns: "components/dialog", + camera: mainCamera, + }), + ); }, - [location.pathname, mainCamera, config?.ui.timezone], + [location.pathname, mainCamera, config?.ui.timezone, t], ); useEffect(() => {