Skip to content

Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.

chore: move Content area toast strings into messages/en.json (#802) (#812)

Maqbool Ahmed0307b0735ca6
diff --git a/web/messages/en.json b/web/messages/en.json
index e8c65ce6f..1d9563f1f 100644
--- a/web/messages/en.json
+++ b/web/messages/en.json
@@ -843,8 +843,30 @@
"active": "Active",
"inactive": "Inactive",
"noWebhook": "No webhook configured",
- "setupFirst": "Set up a webhook to send opportunities to your workflow tools."
- }
+ "setupFirst": "Set up a webhook to send opportunities to your workflow tools.",
+ "urlRequired": "Webhook URL is required",
+ "urlRequiredTest": "Enter a webhook URL first",
+ "saveError": "Failed to save webhook config"
+ },
+ "loadError": "Failed to load content opportunities",
+ "loadOpportunityError": "Failed to load opportunity",
+ "generatedToast": "Generated {count} opportunities",
+ "generationFailed": "Generation failed — please try again",
+ "generationTimedOut": "Generation timed out — please try again",
+ "generateError": "Failed to generate opportunities",
+ "sentToWorkflow": "Sent to workflow!",
+ "sendError": "Failed to send",
+ "dismissError": "Failed to dismiss",
+ "bulkSentToast": "Sent {sent} opportunities to workflow",
+ "bulkSendPartialError": "{failed} failed to send",
+ "bulkSendError": "Failed to send opportunities.",
+ "bulkDoneToast": "Marked {updated} opportunities as done",
+ "bulkUpdateError": "Bulk update failed",
+ "bulkDismissToast": "Dismissed {updated} opportunities",
+ "bulkDismissError": "Bulk dismiss failed",
+ "bulkDeleteError": "Bulk delete failed",
+ "briefGeneratedToast": "Content brief generated!",
+ "briefGenerateError": "Failed to generate brief"
},
"traffic": {
"title": "AI Traffic Analytics",
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/[id]/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/[id]/page.tsx
index 0f3e3a39b..74fbc20b8 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/content/[id]/page.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/[id]/page.tsx
@@ -111,7 +111,7 @@ export default function ContentDetailPage() {
})
.catch((err) => {
console.error('Failed to load opportunity:', err);
- toast.error('Failed to load opportunity');
+ toast.error(t('loadOpportunityError'));
})
.finally(() => setLoading(false));
@@ -119,7 +119,7 @@ export default function ContentDetailPage() {
getBriefQuota()
.then(setQuota)
.catch(() => setQuota(null));
- }, [id]);
+ }, [id, t]);
const handleSend = async () => {
setSending(true);
@@ -128,13 +128,13 @@ export default function ContentDetailPage() {
if (result.success === false) {
toast.error(result.error);
} else {
- toast.success('Sent to workflow!');
+ toast.success(t('sentToWorkflow'));
const updated = await getOpportunity(id);
setOpportunity(updated);
}
} catch (err) {
console.error('Send failed:', err);
- toast.error('Failed to send');
+ toast.error(t('sendError'));
} finally {
setSending(false);
}
@@ -160,7 +160,7 @@ export default function ContentDetailPage() {
},
});
} catch {
- toast.error('Failed to dismiss');
+ toast.error(t('dismissError'));
}
};
@@ -170,10 +170,10 @@ export default function ContentDetailPage() {
const result = await generateBrief(id);
setBrief(result.brief);
if (result.quota) setQuota(result.quota);
- toast.success('Content brief generated!');
+ toast.success(t('briefGeneratedToast'));
} catch (err) {
console.error('Brief generation failed:', err);
- toast.error(err instanceof Error ? err.message : 'Failed to generate brief');
+ toast.error(err instanceof Error ? err.message : t('briefGenerateError'));
// Refresh the counter — the failure may have been a quota rejection.
getBriefQuota()
.then(setQuota)
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/_webhook-settings.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/_webhook-settings.tsx
index 74a71c0fd..550e3cfb7 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/content/_webhook-settings.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/_webhook-settings.tsx
@@ -55,7 +55,7 @@ export function WebhookSettingsDialog({ open, onOpenChange, brandId }: WebhookSe
const handleSave = async () => {
if (!url.trim()) {
- toast.error('Webhook URL is required');
+ toast.error(t('urlRequired'));
return;
}
setSaving(true);
@@ -69,7 +69,7 @@ export function WebhookSettingsDialog({ open, onOpenChange, brandId }: WebhookSe
onOpenChange(false);
} catch (err) {
console.error('Save webhook failed:', err);
- toast.error('Failed to save webhook config');
+ toast.error(t('saveError'));
} finally {
setSaving(false);
}
@@ -77,7 +77,7 @@ export function WebhookSettingsDialog({ open, onOpenChange, brandId }: WebhookSe
const handleTest = async () => {
if (!url.trim()) {
- toast.error('Enter a webhook URL first');
+ toast.error(t('urlRequiredTest'));
return;
}
setTesting(true);
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/page.tsx
index 23fefe0bc..b1a177d2c 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/content/page.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/page.tsx
@@ -223,7 +223,7 @@ export default function ContentPage() {
return data.total;
} catch (err) {
console.error('Failed to load opportunities:', err);
- toast.error('Failed to load content opportunities');
+ toast.error(t('loadError'));
return 0;
} finally {
if (!isCancelled?.()) {
@@ -231,7 +231,7 @@ export default function ContentPage() {
}
}
},
- [activeBrandId, statusFilter, impactFilter, typeFilter, pager.start, debouncedSearch],
+ [activeBrandId, statusFilter, impactFilter, typeFilter, pager.start, debouncedSearch, t],
);
useEffect(() => {
@@ -268,7 +268,7 @@ export default function ContentPage() {
pollRef.current = false;
clearGenerationJob();
setGenerating(false);
- toast.success(`Generated ${status.result?.generated ?? 0} opportunities`);
+ toast.success(t('generatedToast', { count: status.result?.generated ?? 0 }));
loadData();
break;
}
@@ -277,7 +277,7 @@ export default function ContentPage() {
pollRef.current = false;
clearGenerationJob();
setGenerating(false);
- toast.error(status.failedReason || 'Generation failed — please try again');
+ toast.error(status.failedReason || t('generationFailed'));
break;
}
@@ -285,7 +285,7 @@ export default function ContentPage() {
pollRef.current = false;
clearGenerationJob();
setGenerating(false);
- toast.error('Generation timed out — please try again');
+ toast.error(t('generationTimedOut'));
break;
}
} catch {
@@ -296,7 +296,7 @@ export default function ContentPage() {
poll();
},
- [loadData],
+ [loadData, t],
);
// Restore generation state from localStorage on mount
useEffect(() => {
@@ -319,7 +319,7 @@ export default function ContentPage() {
pollJob(jobId, startedAt);
} catch (err) {
console.error('Generate failed:', err);
- toast.error(err instanceof Error ? err.message : 'Failed to generate opportunities');
+ toast.error(err instanceof Error ? err.message : t('generateError'));
setGenerating(false);
}
};
@@ -331,12 +331,12 @@ export default function ContentPage() {
if (result.success === false) {
toast.error(result.error);
} else {
- toast.success('Sent to workflow!');
+ toast.success(t('sentToWorkflow'));
await loadData(true);
}
} catch (err) {
console.error('Webhook send failed:', err);
- toast.error('Failed to send');
+ toast.error(t('sendError'));
} finally {
setSendingId(null);
}
@@ -361,7 +361,7 @@ export default function ContentPage() {
});
} catch (err) {
console.error('Dismiss failed:', err);
- toast.error('Failed to dismiss');
+ toast.error(t('dismissError'));
}
};
@@ -373,13 +373,13 @@ export default function ContentPage() {
toast.error(result.error);
return;
}
- toast.success(`Sent ${result.sent} opportunities to workflow`);
- if (result.failed > 0) toast.error(`${result.failed} failed to send`);
+ toast.success(t('bulkSentToast', { sent: result.sent }));
+ if (result.failed > 0) toast.error(t('bulkSendPartialError', { failed: result.failed }));
setSelectedIds(new Set());
await loadData(true);
} catch (err) {
console.error('Bulk webhook send failed:', err);
- toast.error('Failed to send opportunities.');
+ toast.error(t('bulkSendError'));
} finally {
setBulkSending(false);
}
@@ -391,11 +391,11 @@ export default function ContentPage() {
try {
const ids = Array.from(selectedIds);
const result = await bulkUpdateStatus(ids, 'done');
- toast.success(`Marked ${result.updated} opportunities as done`);
+ toast.success(t('bulkDoneToast', { updated: result.updated }));
setSelectedIds(new Set());
await loadData(true);
} catch (err) {
- toast.error(err instanceof Error ? err.message : 'Bulk update failed');
+ toast.error(err instanceof Error ? err.message : t('bulkUpdateError'));
} finally {
setBulkSending(false);
}
@@ -406,11 +406,11 @@ export default function ContentPage() {
try {
const ids = Array.from(selectedIds);
const result = await bulkUpdateStatus(ids, 'dismissed');
- toast.success(`Dismissed ${result.updated} opportunities`);
+ toast.success(t('bulkDismissToast', { updated: result.updated }));
setSelectedIds(new Set());
await loadData(true);
} catch (err) {
- toast.error(err instanceof Error ? err.message : 'Bulk dismiss failed');
+ toast.error(err instanceof Error ? err.message : t('bulkDismissError'));
} finally {
setBulkSending(false);
}
@@ -428,7 +428,7 @@ export default function ContentPage() {
// here as well would fire a second, competing load.
await loadData(true);
} catch (err) {
- toast.error(err instanceof Error ? err.message : 'Bulk delete failed');
+ toast.error(err instanceof Error ? err.message : t('bulkDeleteError'));
} finally {
setBulkSending(false);
}