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
+5 -5
View File
@@ -4,7 +4,7 @@ import { qk } from "../../lib/queryKeys";
import { History, RefreshCw } from "lucide-react";
import { api } from "../../lib/api";
import { formatEta, formatNumber, quotaActionLabel } from "../../lib/format";
import { notify } from "../../lib/notifications";
import { msg, notify } from "../../lib/notifications";
import { notifyYouTubeActionError } from "../../lib/youtubeErrors";
import { useWizard } from "../../features/wizard/wizardContext";
import Tooltip from "../../components/ui/Tooltip";
@@ -43,7 +43,7 @@ function Overview() {
qc.invalidateQueries({ queryKey: qk.channels() });
notify({
level: "success",
message: t("stats.sync.synced", { count: r.subscriptions ?? 0 }),
message: msg("stats.sync.synced", { count: r.subscriptions ?? 0 }),
});
},
// The same helper and the same wizard handle as the Channels page: it translates the 403 into
@@ -51,7 +51,7 @@ function Overview() {
// English detail under a Hungarian UI — and delegates everything else to notifyActionError so
// the server's own reason wins, which is what makes the SEC-14 cooldown read as a pace limit
// rather than "Sync failed".
onError: (e) => notifyYouTubeActionError(e, t("stats.sync.syncFailed"), openWizard),
onError: (e) => notifyYouTubeActionError(e, msg("stats.sync.syncFailed"), openWizard),
});
const deepAll = useMutation({
mutationFn: () => api.deepAll(true),
@@ -60,10 +60,10 @@ function Overview() {
qc.invalidateQueries({ queryKey: qk.channels() });
notify({
level: "success",
message: t("stats.sync.fullHistoryRequested", { count: r.updated ?? 0 }),
message: msg("stats.sync.fullHistoryRequested", { count: r.updated ?? 0 }),
});
},
onError: (e) => notifyActionError(e, t("stats.sync.fullHistoryFailed")),
onError: (e) => notifyActionError(e, msg("stats.sync.fullHistoryFailed")),
});
return (