fix(notifications): a notice keeps what to say and says it in the reader's language when shown

This commit is contained in:
2026-10-29 22:37:14 +01:00
parent 6986eb1937
commit 4ef772d37b
125 changed files with 973 additions and 674 deletions
+8 -6
View File
@@ -31,7 +31,7 @@ import { Button } from "../../components/ui/Button";
import { LoadingState, StateMessage } from "../../components/ui/QueryState";
import { useConfirm } from "../../components/ui/confirmContext";
import { formatDateTime, formatNumber, formatUnit, relativeTime } from "../../lib/format";
import { notify } from "../../lib/notifications";
import { msg, notify } from "../../lib/notifications";
import Tooltip from "../../components/ui/Tooltip";
import { notifyActionError } from "../../lib/actionErrors";
import { IconButton } from "../../components/ui/IconButton";
@@ -550,14 +550,14 @@ export default function Scheduler() {
const pauseResume = useMutation({
mutationFn: (paused: boolean) => (paused ? api.resumeSync() : api.pauseSync()),
onSuccess: () => qc.invalidateQueries({ queryKey: qk.scheduler() }),
onError: (e) => notifyActionError(e, t("scheduler.toggleFailed")),
onError: (e) => notifyActionError(e, msg("scheduler.toggleFailed")),
});
const intervalMut = useMutation({
mutationFn: (v: { jobId: string; minutes: number }) =>
api.updateSchedulerJob(v.jobId, v.minutes),
onSuccess: () => qc.invalidateQueries({ queryKey: qk.scheduler() }),
onError: (e) => notifyActionError(e, t("scheduler.intervalFailed")),
onError: (e) => notifyActionError(e, msg("scheduler.intervalFailed")),
});
// Manual "run now" triggers. The wrapper runs in a background thread server-side; the
@@ -568,7 +568,9 @@ export default function Scheduler() {
onSuccess: (_d, jobId) => {
notify({
level: "success",
message: t("scheduler.triggered", { job: t(`scheduler.jobs.${jobId}`, jobId) }),
message: msg("scheduler.triggered", {
job: msg(`scheduler.jobs.${jobId}`, { defaultValue: jobId }),
}),
});
qc.invalidateQueries({ queryKey: qk.scheduler() });
},
@@ -579,7 +581,7 @@ export default function Scheduler() {
onSuccess: (res) => {
notify({
level: "success",
message: t("scheduler.triggeredAll", { count: res.started.length }),
message: msg("scheduler.triggeredAll", { count: res.started.length }),
});
qc.invalidateQueries({ queryKey: qk.scheduler() });
},
@@ -595,7 +597,7 @@ export default function Scheduler() {
onSuccess: (res) => {
const removed =
(res.search_videos_deleted ?? 0) + (res.videos_deleted ?? 0) + (res.channels_deleted ?? 0);
notify({ level: "success", message: t("scheduler.purgedDiscovery", { count: removed }) });
notify({ level: "success", message: msg("scheduler.purgedDiscovery", { count: removed }) });
qc.invalidateQueries({ queryKey: qk.scheduler() });
},
});