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.
TypeScript aeoai-agentai-searchanswer-engine-optimizationbrand-monitoringchatgptclaudecopilotdockergeminigeogoogle-ai-overviewsgrokmcpnextjsopen-sourceperplexityseosupabasetypescript
fix(i18n): wire useTranslations across remaining hardcoded surfaces (Closes #768) (#788)
Maqbool Ahmedc7452d151409
diff --git a/web/messages/en.json b/web/messages/en.jsonindex 57746262f..81f10cd5e 100644--- a/web/messages/en.json+++ b/web/messages/en.json@@ -19,7 +19,30 @@"minutesAgo": "{m}m ago","hoursAgo": "{h}h ago","daysAgo": "{d}d ago"- }+ },+ "exportCsv": "Export CSV",+ "exporting": "Exporting...",+ "dateRange": "Date Range",+ "custom": "Custom",+ "from": "From",+ "to": "To",+ "topic": "Topic",+ "prompt": "Prompt",+ "platform": "Platform",+ "region": "Region",+ "aiModel": "AI Model",+ "allTopics": "All Topics",+ "allPrompts": "All Prompts",+ "allPlatforms": "All Platforms",+ "allRegions": "All Regions",+ "searchPrompts": "Search prompts…",+ "noPromptsMatch": "No prompts match.",+ "sources": "Sources",+ "sourceAll": "All",+ "sourceBrand": "Brand",+ "sourceCompetitors": "Competitors",+ "sourceThirdParty": "Third-Party",+ "all": "All"},"nav": {"overview": "Overview",@@ -34,7 +57,9 @@"citations": "Citations","shopping": "Shopping","reports": "Reports",- "settings": "Settings"+ "settings": "Settings",+ "analytics": "Analytics",+ "optimization": "Optimization"},"agent": {"newChat": "New chat",@@ -208,7 +233,6 @@"noBrandBody": "Select a brand from the top switcher to view topic analytics.","title": "Topics","description": "Topic-level analytics across all tracked prompts (last 30 days)",- "exportCsv": "Export CSV","exportHint": "No topics yet - add topics or run a tracking job first.","manageTopics": "Manage topics","kpi": {@@ -483,7 +507,6 @@"appearancePlatform": "Platform","appearanceMerchant": "Merchant Link","appearanceRaw": "Raw Card Details",- "exportCsv": "Export CSV","compDistinctProducts": "Distinct Products","compSov": "Shopping SOV","compSummaryTitle": "Competitor Summary",@@ -712,7 +735,48 @@"subscriptionCanceled": "Your subscription has been canceled.","needCustomPlan": "Need a custom plan?","customPlanDescription": "Get unlimited brands, custom integrations, dedicated support, and more.",- "contactUs": "Contact Us"+ "contactUs": "Contact Us",+ "integrations": "Integrations",+ "agent": "Agent",+ "apiKeys_description": "Long-lived tokens for the Ansvisor MCP server and other external clients. Keys are shown once at creation — store them somewhere safe.",+ "apiKeys_mcpEndpoint": "MCP endpoint",+ "apiKeys_mcpEndpointHint": "Paste this URL + a key below into Claude Desktop / Claude Code / Cursor. See the <link>MCP guide</link>.",+ "apiKeys_noKeys": "No API keys yet. Create one to connect the MCP server.",+ "apiKeys_revoked": "revoked",+ "apiKeys_created": "Created {date} · Last used {lastUsed}",+ "apiKeys_newKey": "New key",+ "apiKeys_newKeyTitle": "New API key",+ "apiKeys_newKeyDescription": "Give this key a memorable name (e.g. \"MCP — my laptop\").",+ "apiKeys_namePlaceholder": "MCP — local",+ "apiKeys_create": "Create",+ "apiKeys_copyTitle": "Copy your API key",+ "apiKeys_copyDescription": "You won't be able to see this again. Store it somewhere safe.",+ "apiKeys_done": "Done",+ "apiKeys_name": "Name",+ "agent_description": "Bring your own Anthropic API key. The in-product agent uses your key to call Claude directly — usage is billed to your Anthropic account, not to Ansvisor.",+ "agent_keyConfigured": "Key configured",+ "agent_savedAt": "Saved {date}",+ "agent_savedBy": "by {email}",+ "agent_noKey": "No key configured. The agent will be locked for everyone in this organization until a key is saved.",+ "agent_replaceKey": "Replace key",+ "agent_anthropicKeyLabel": "Anthropic API key",+ "agent_keyPlaceholder": "sk-ant-…",+ "agent_replace": "Replace",+ "agent_keyHint": "Get a key from <link>console.anthropic.com</link>. The key is encrypted at rest; Ansvisor support cannot read it.",+ "agent_removeKey": "Remove key",+ "agent_adminOnly": "Admin-only setting",+ "agent_adminOnlyHint": "Only org admins can add, replace, or remove the Anthropic API key. Ask an admin if you need it changed.",+ "integrations_cancel": "Cancel",+ "integrations_connecting": "Connecting…",+ "integrations_connect": "Connect",+ "integrations_propertyMapping": "Property mapping",+ "integrations_notMapped": "Not mapped",+ "integrations_selectProperty": "Select a property",+ "integrations_description": "Connect external data sources. Connections are shared with your whole organization.",+ "integrations_connected": "Connected",+ "integrations_notConfigured": "Not configured",+ "integrations_disconnect": "Disconnect",+ "integrations_disconnectDescription": "The stored connection is removed for the whole organization. You can reconnect at any time."},"brands": {"title": "Brands",diff --git a/web/src/app/[locale]/(dashboard)/dashboard/citations/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/citations/page.tsxindex 6435c1cd8..89c08c6d9 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/citations/page.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/citations/page.tsx@@ -804,6 +804,7 @@ function triggerDownload(csv: string, filename: string) {export default function CitationsPage() {const t = useTranslations('citations');+ const tCommon = useTranslations('common');const { getActiveBrand } = useBrandStore();const brand = getActiveBrand();@@ -1157,7 +1158,7 @@ export default function CitationsPage() {<Download className="h-4 w-4" />)}- {isExporting ? 'Exporting...' : 'Export CSV'}+ {isExporting ? tCommon('exporting') : tCommon('exportCsv')}</Button></span></div>diff --git a/web/src/app/[locale]/(dashboard)/dashboard/insights/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/insights/page.tsxindex c0576648b..831e760da 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/insights/page.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/insights/page.tsx@@ -489,6 +489,7 @@ function FilterBar({availableModels: string[];availableTopics: Topic[];}) {+ const t = useTranslations('common');const set = (patch: Partial<InsightsFilters>) => onChange({ ...filters, ...patch });return (@@ -506,22 +507,24 @@ function FilterBar({{/* Topic filter */}{availableTopics.length > 0 && (<div>- <label className="mb-1.5 block text-xs font-medium text-muted-foreground">Topic</label>+ <label className="mb-1.5 block text-xs font-medium text-muted-foreground">+ {t('topic')}+ </label><Selectvalue={filters.topic || null}onValueChange={(v) => set({ topic: !v || v === '__all__' ? '' : v })}><SelectTrigger className="h-8 w-40 text-xs">- <SelectValue placeholder="All Topics">+ <SelectValue placeholder={t('allTopics')}>{(value) =>value && value !== '__all__'- ? (availableTopics.find((t) => t.id === value)?.name ?? 'All Topics')- : 'All Topics'+ ? (availableTopics.find((topic) => topic.id === value)?.name ?? t('allTopics'))+ : t('allTopics')}</SelectValue></SelectTrigger><SelectContent>- <SelectItem value="__all__">All Topics</SelectItem>+ <SelectItem value="__all__">{t('allTopics')}</SelectItem>{availableTopics.map((t) => (<SelectItem key={t.id} value={t.id}>{t.name}@@ -534,20 +537,22 @@ function FilterBar({{/* Region filter */}<div>- <label className="mb-1.5 block text-xs font-medium text-muted-foreground">Region</label>+ <label className="mb-1.5 block text-xs font-medium text-muted-foreground">+ {t('region')}+ </label><Selectvalue={filters.region || null}onValueChange={(v) => set({ region: !v || v === '__all__' ? '' : v })}><SelectTrigger className="h-8 w-48 text-xs">- <SelectValue placeholder="All Regions">+ <SelectValue placeholder={t('allRegions')}>{(value) =>- value && value !== '__all__' ? formatRegionDisplay(String(value)) : 'All Regions'+ value && value !== '__all__' ? formatRegionDisplay(String(value)) : t('allRegions')}</SelectValue></SelectTrigger><SelectContent>- <SelectItem value="__all__">All Regions</SelectItem>+ <SelectItem value="__all__">{t('allRegions')}</SelectItem>{availableRegions.map((r) => (<SelectItem key={r} value={r}>{formatRegionDisplay(r)}@@ -559,15 +564,17 @@ function FilterBar({{/* Model filter */}<div>- <label className="mb-1.5 block text-xs font-medium text-muted-foreground">AI Model</label>+ <label className="mb-1.5 block text-xs font-medium text-muted-foreground">+ {t('aiModel')}+ </label><Selectvalue={filters.model || null}onValueChange={(v) => set({ model: !v || v === '__all__' ? '' : v })}><SelectTrigger className="h-8 w-44 text-xs">- <SelectValue placeholder="All Platforms">+ <SelectValue placeholder={t('allPlatforms')}>{(value) => {- if (!value || value === '__all__') return 'All Platforms';+ if (!value || value === '__all__') return t('allPlatforms');const firstSlug = String(value).split(',')[0];return (MODEL_PROVIDER_LABELS[firstSlug] ??@@ -578,7 +585,7 @@ function FilterBar({</SelectValue></SelectTrigger><SelectContent>- <SelectItem value="__all__">All Platforms</SelectItem>+ <SelectItem value="__all__">{t('allPlatforms')}</SelectItem>{availableModels.map((m) => {// m is a comma-separated slug list representing a provider familyconst firstSlug = m.split(',')[0];@@ -1433,7 +1440,7 @@ export default function InsightsPage() {) : (<Download className="h-4 w-4" />)}- {isExporting ? 'Exporting...' : 'Export CSV'}+ {isExporting ? tCommon('exporting') : tCommon('exportCsv')}</Button><Link href="/dashboard/reports" className={cn(buttonVariants(), 'gap-2')}>diff --git a/web/src/app/[locale]/(dashboard)/dashboard/prompts/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/prompts/page.tsxindex 58d37d159..c3f27b504 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/prompts/page.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/prompts/page.tsx@@ -962,6 +962,7 @@ export default function PromptsPage() {const { canManage } = useUserRole();const activeBrandId = useBrandStore((s) => s.activeBrandId);+ const tCommon = useTranslations('common');const activeBrand = useBrandStore((s) => s.brands.find((brand) => brand.id === s.activeBrandId) ?? null,);@@ -1469,7 +1470,7 @@ export default function PromptsPage() {disabled={!canExport}><Download className="h-4 w-4" />- Export CSV+ {tCommon('exportCsv')}</Button></span>)}diff --git a/web/src/app/[locale]/(dashboard)/dashboard/settings/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/settings/page.tsxindex 63a456f07..c7c2f1cfd 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/settings/page.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/settings/page.tsx@@ -71,11 +71,11 @@ export default function SettingsPage() {{ id: 'project', label: t('project') },{ id: 'team', label: t('team') },{ id: 'notifications', label: t('notifications') },- { id: 'integrations', label: 'Integrations' },- { id: 'api-keys', label: 'API Keys' },+ { id: 'integrations', label: t('integrations') },+ { id: 'api-keys', label: t('apiKeys') },// Agent BYOK is a cloud-only concern — self-host operators configure// ANTHROPIC_API_KEY in their own env, no UI needed.- ...(isCloud ? [{ id: 'agent' as Section, label: 'Agent' }] : []),+ ...(isCloud ? [{ id: 'agent' as Section, label: t('agent') }] : []),...(isCloud ? [{ id: 'billing' as Section, label: t('billing') }] : []),];diff --git a/web/src/app/[locale]/(dashboard)/dashboard/shopping/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/shopping/page.tsxindex a6fb95f63..31b64493b 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/shopping/page.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/shopping/page.tsx@@ -105,6 +105,7 @@ function getDomainName(url: string): string {}export default function ShoppingPage() {const t = useTranslations('shopping');+ const tCommon = useTranslations('common');const { activeBrandId } = useBrandStore();const { canUse, requiredPlanFor } = useFeatureGate();const hasFullAccess = canUse('shopping_analytics');@@ -331,7 +332,7 @@ export default function ShoppingPage() {}}><Download className="mr-2 h-4 w-4" />- {t('exportCsv')}+ {tCommon('exportCsv')}</Button></div><ProductTable@@ -398,7 +399,7 @@ export default function ShoppingPage() {}}><Download className="mr-2 h-4 w-4" />- {t('exportCsv')}+ {tCommon('exportCsv')}</Button></div><ProductTable@@ -441,6 +442,7 @@ function PromptsTabContent({promptsData: CardEligiblePromptsResponse | null;loading: boolean;}) {+ const tCommon = useTranslations('common');const [searchQuery, setSearchQuery] = useState('');const [selectedPrompt, setSelectedPrompt] = useState<CardEligiblePromptRow | null>(null);@@ -527,7 +529,7 @@ function PromptsTabContent({className="gap-1.5"><Download className="h-3.5 w-3.5" />- {t('exportCsv')}+ {tCommon('exportCsv')}</Button></div>diff --git a/web/src/app/[locale]/(dashboard)/dashboard/topics/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/topics/page.tsxindex 7a011e891..ca74b64fd 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/topics/page.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/topics/page.tsx@@ -393,7 +393,7 @@ export default function TopicsPage() {disabled={!canExport}><Download className="h-4 w-4" />- {t('exportCsv')}+ {common('exportCsv')}</Button></span><Linkdiff --git a/web/src/app/[locale]/(dashboard)/dashboard/traffic/page.tsx b/web/src/app/[locale]/(dashboard)/dashboard/traffic/page.tsxindex 296898974..46248793d 100644--- a/web/src/app/[locale]/(dashboard)/dashboard/traffic/page.tsx+++ b/web/src/app/[locale]/(dashboard)/dashboard/traffic/page.tsx@@ -655,7 +655,7 @@ function TrafficPageContent({ brand }: { brand: Brand }) {) : (<Download className="h-4 w-4" />)}- {isExporting ? 'Exporting...' : 'Export CSV'}+ {isExporting ? tCommon('exporting') : tCommon('exportCsv')}</Button></div></div>diff --git a/web/src/components/citations/filter-bar.tsx b/web/src/components/citations/filter-bar.tsxindex 42948b9e9..65ad28e58 100644--- a/web/src/components/citations/filter-bar.tsx+++ b/web/src/components/citations/filter-bar.tsx@@ -8,6 +8,7 @@*/import { useMemo } from 'react';+import { useTranslations } from 'next-intl';import type { Topic } from '@/types';import { cn } from '@/lib/utils';import type { CitationsDatePreset } from '@/lib/actions/citations';@@ -88,8 +89,15 @@ export function SourceScopeFilter({onChange: (scope: SourceScope) => void;className?: string;}) {+ const t = useTranslations('common');+ const scopeLabel: Record<SourceScope, string> = {+ all: t('sourceAll'),+ own: t('sourceBrand'),+ competitors: t('sourceCompetitors'),+ third_party: t('sourceThirdParty'),+ };return (- <div className={cn('flex flex-wrap gap-2', className)} role="group" aria-label="Sources">+ <div className={cn('flex flex-wrap gap-2', className)} role="group" aria-label={t('sources')}>{SOURCE_SCOPES.map((scope) => (<buttonkey={scope.value}@@ -103,7 +111,7 @@ export function SourceScopeFilter({: 'bg-card text-foreground hover:bg-muted',)}>- {scope.label}+ {scopeLabel[scope.value]}</button>))}</div>@@ -235,6 +243,7 @@ export function CitationsFilterBar({// base-ui Combobox needs `{ value, label }` shaped items so it can use the// built-in filter and display logic without custom item-to-string helpers.// Truncate long prompt text so the dropdown stays a sensible width.+ const t = useTranslations('common');const promptComboboxItems = useMemo<PromptComboboxItem[]>(() =>prompts.map((p) => ({@@ -261,25 +270,27 @@ export function CitationsFilterBar({{topics.length > 0 && (<div>- <label className="mb-1.5 block text-xs font-medium text-muted-foreground">Topic</label>+ <label className="mb-1.5 block text-xs font-medium text-muted-foreground">+ {t('topic')}+ </label><Selectvalue={filters.topic || null}onValueChange={(v) => onChange({ topic: !v || v === '__all__' ? '' : v })}><SelectTrigger className="h-8 w-40 text-xs">- <SelectValue placeholder="All Topics">+ <SelectValue placeholder={t('allTopics')}>{(value) =>value && value !== '__all__'- ? (topics.find((t) => t.id === value)?.name ?? 'All Topics')- : 'All Topics'+ ? (topics.find((t) => t.id === value)?.name ?? t('allTopics'))+ : t('allTopics')}</SelectValue></SelectTrigger><SelectContent>- <SelectItem value="__all__">All Topics</SelectItem>- {topics.map((t) => (- <SelectItem key={t.id} value={t.id}>- {t.name}+ <SelectItem value="__all__">{t('allTopics')}</SelectItem>+ {topics.map((topic) => (+ <SelectItem key={topic.id} value={topic.id}>+ {topic.name}</SelectItem>))}</SelectContent>@@ -289,7 +300,9 @@ export function CitationsFilterBar({{prompts.length > 0 && (<div>- <label className="mb-1.5 block text-xs font-medium text-muted-foreground">Prompt</label>+ <label className="mb-1.5 block text-xs font-medium text-muted-foreground">+ {t('prompt')}+ </label><Comboboxitems={promptComboboxItems}value={@@ -304,12 +317,12 @@ export function CitationsFilterBar({}><ComboboxTrigger className="h-8 w-56 text-xs">- <ComboboxValue placeholder="All Prompts" />+ <ComboboxValue placeholder={t('allPrompts')} /></ComboboxTrigger><ComboboxContent>- <ComboboxInput placeholder="Search prompts…" />+ <ComboboxInput placeholder={t('searchPrompts')} /><ComboboxList>- <ComboboxEmpty>No prompts match.</ComboboxEmpty>+ <ComboboxEmpty>{t('noPromptsMatch')}</ComboboxEmpty><ComboboxCollection>{(item: PromptComboboxItem) => (<ComboboxItem key={item.value} value={item} title={item.fullText}>@@ -324,23 +337,25 @@ export function CitationsFilterBar({)}<div>- <label className="mb-1.5 block text-xs font-medium text-muted-foreground">Platform</label>+ <label className="mb-1.5 block text-xs font-medium text-muted-foreground">+ {t('platform')}+ </label><Selectvalue={filters.platform || null}onValueChange={(v) => onChange({ platform: !v || v === '__all__' ? '' : v })}><SelectTrigger className="h-8 w-40 text-xs">- <SelectValue placeholder="All Platforms">+ <SelectValue placeholder={t('allPlatforms')}>{(value) =>value && value !== '__all__'? (platforms.find((platform) => platform.value === value)?.label ??getGroupedPlatformLabel(value))- : 'All Platforms'+ : t('allPlatforms')}</SelectValue></SelectTrigger><SelectContent>- <SelectItem value="__all__">All Platforms</SelectItem>+ <SelectItem value="__all__">{t('allPlatforms')}</SelectItem>{platforms.map((platform) => (<SelectItem key={platform.value} value={platform.value}>{platform.label}@@ -351,16 +366,18 @@ export function CitationsFilterBar({</div><div>- <label className="mb-1.5 block text-xs font-medium text-muted-foreground">Region</label>+ <label className="mb-1.5 block text-xs font-medium text-muted-foreground">+ {t('region')}+ </label><Selectvalue={filters.region || null}onValueChange={(v) => onChange({ region: !v || v === '__all__' ? '' : v })}><SelectTrigger className="h-8 w-32 text-xs">- <SelectValue placeholder="All Regions" />+ <SelectValue placeholder={t('allRegions')} /></SelectTrigger><SelectContent>- <SelectItem value="__all__">All Regions</SelectItem>+ <SelectItem value="__all__">{t('allRegions')}</SelectItem>{regions.map((r) => (<SelectItem key={r} value={r}>{r}diff --git a/web/src/components/filters/date-range-filter.tsx b/web/src/components/filters/date-range-filter.tsxindex 90a2b48c4..892dded52 100644--- a/web/src/components/filters/date-range-filter.tsx+++ b/web/src/components/filters/date-range-filter.tsx@@ -1,5 +1,6 @@'use client';+import { useTranslations } from 'next-intl';import { Input } from '@/components/ui/input';import { cn } from '@/lib/utils';@@ -28,9 +29,9 @@ export const ALL_DATE_PRESETS: readonly DateRangePreset[] = ['custom',];-export function dateRangePresetLabel(preset: DateRangePreset): string {- if (preset === 'custom') return 'Custom';- if (preset === 'all') return 'All';+export function dateRangePresetLabel(preset: DateRangePreset, t: (key: string) => string): string {+ if (preset === 'custom') return t('custom');+ if (preset === 'all') return t('all');return preset;}@@ -57,20 +58,28 @@ export function DateRangeFilter<P extends string = DateRangePreset>({value,onChange,presets,- label = 'Date Range',+ label,from,to,onFromChange,onToChange,className,}: DateRangeFilterProps<P>) {+ const t = useTranslations('common');+ const resolvedLabel = label ?? t('dateRange');const showCustom = value === 'custom' && onFromChange && onToChange;return (<><div className={className}>- <label className="mb-1.5 block text-xs font-medium text-muted-foreground">{label}</label>- <div className="flex rounded-md border overflow-hidden" role="group" aria-label={label}>+ <label className="mb-1.5 block text-xs font-medium text-muted-foreground">+ {resolvedLabel}+ </label>+ <div+ className="flex rounded-md border overflow-hidden"+ role="group"+ aria-label={resolvedLabel}+ >{presets.map((preset) => (<buttonkey={preset}@@ -84,7 +93,7 @@ export function DateRangeFilter<P extends string = DateRangePreset>({: 'bg-card hover:bg-muted text-foreground',)}>- {dateRangePresetLabel(preset as DateRangePreset)}+ {dateRangePresetLabel(preset as DateRangePreset, t)}</button>))}</div>@@ -93,7 +102,9 @@ export function DateRangeFilter<P extends string = DateRangePreset>({{showCustom && (<><div>- <label className="mb-1.5 block text-xs font-medium text-muted-foreground">From</label>+ <label className="mb-1.5 block text-xs font-medium text-muted-foreground">+ {t('from')}+ </label><Inputtype="date"value={from ?? ''}@@ -102,7 +113,9 @@ export function DateRangeFilter<P extends string = DateRangePreset>({/></div><div>- <label className="mb-1.5 block text-xs font-medium text-muted-foreground">To</label>+ <label className="mb-1.5 block text-xs font-medium text-muted-foreground">+ {t('to')}+ </label><Inputtype="date"value={to ?? ''}diff --git a/web/src/components/layout/sidebar.tsx b/web/src/components/layout/sidebar.tsxindex 2832afe56..b060a7cab 100644--- a/web/src/components/layout/sidebar.tsx+++ b/web/src/components/layout/sidebar.tsx@@ -6,7 +6,11 @@ import { useEffect, useState } from 'react';import { useTranslations } from 'next-intl';import { usePathname, Link } from '@/i18n/navigation';import { dashboardNav } from '@/config/dashboard';-import { getDashboardNavLabel, shouldShowDashboardNavItem } from '@/lib/dashboard-navigation';+import {+ getDashboardNavLabel,+ getDashboardNavGroupLabel,+ shouldShowDashboardNavItem,+} from '@/lib/dashboard-navigation';import { useSidebarStore } from '@/stores/use-sidebar-store';import { useBrandStore } from '@/stores/use-brand-store';import { useFeatureGate } from '@/hooks/use-feature-gate';@@ -87,7 +91,7 @@ export function Sidebar() {<div key={i} className="mb-4">{group.title && !isCollapsed && (<p className="mb-1 px-2 text-xs font-medium uppercase tracking-wider text-muted-foreground">- {group.title}+ {getDashboardNavGroupLabel(group.title, t)}</p>)}{/* A group with no title has no header to set it apart, so itdiff --git a/web/src/components/settings/agent-section.tsx b/web/src/components/settings/agent-section.tsxindex e18d283ce..f7fcd3bda 100644--- a/web/src/components/settings/agent-section.tsx+++ b/web/src/components/settings/agent-section.tsx@@ -9,6 +9,7 @@ import { Label } from '@/components/ui/label';import { Badge } from '@/components/ui/badge';import { Skeleton } from '@/components/ui/skeleton';import { Loader2, Lock, Sparkles, Trash2, CheckCircle2 } from 'lucide-react';+import { useTranslations } from 'next-intl';import { useUserRole } from '@/hooks/use-user-role';interface KeyState {@@ -39,6 +40,8 @@ function formatDate(iso: string | null): string {* On save / clear we just refetch.*/export function AgentSection() {+ const t = useTranslations('settings');+ const tCommon = useTranslations('common');const [state, setState] = useState<KeyState | null>(null);const [loading, setLoading] = useState(true);const [input, setInput] = useState('');@@ -121,12 +124,9 @@ export function AgentSection() {<CardHeader><CardTitle className="flex items-center gap-2"><Sparkles className="h-4 w-4" />- Agent+ {t('agent')}</CardTitle>- <CardDescription>- Bring your own Anthropic API key. The in-product agent uses your key to call Claude- directly — usage is billed to your Anthropic account, not to Ansvisor.- </CardDescription>+ <CardDescription>{t('agent_description')}</CardDescription></CardHeader><CardContent className="space-y-4">{loading ? (@@ -136,29 +136,26 @@ export function AgentSection() {<div className="flex items-center gap-2"><Badge variant="secondary" className="gap-1"><CheckCircle2 className="h-3 w-3" />- Key configured+ {t('agent_keyConfigured')}</Badge>{state.last4 && (<code className="text-xs font-mono text-muted-foreground">sk-…{state.last4}</code>)}</div><p className="text-xs text-muted-foreground">- Saved {formatDate(state.setAt)}- {state.setByEmail && ` by ${state.setByEmail}`}.+ {t('agent_savedAt', { date: formatDate(state.setAt) })}+ {state.setByEmail && ` ${t('agent_savedBy', { email: state.setByEmail })}`}.</p></div>) : (- <p className="text-sm text-muted-foreground">- No key configured. The agent will be locked for everyone in this organization until a- key is saved.- </p>+ <p className="text-sm text-muted-foreground">{t('agent_noKey')}</p>)}{canAdmin ? (<><div className="space-y-2"><Label htmlFor="anthropic-key">- {configured ? 'Replace key' : 'Anthropic API key'}+ {configured ? t('agent_replaceKey') : t('agent_anthropicKeyLabel')}</Label><div className="flex gap-2"><Input@@ -166,7 +163,7 @@ export function AgentSection() {type="password"autoComplete="off"spellCheck={false}- placeholder="sk-ant-…"+ placeholder={t('agent_keyPlaceholder')}value={input}onChange={(e) => setInput(e.target.value)}disabled={saving}@@ -174,20 +171,22 @@ export function AgentSection() {/><Button onClick={handleSave} disabled={saving || !input.trim()}>{saving && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}- {isReplacing ? 'Replace' : 'Save'}+ {isReplacing ? t('agent_replace') : tCommon('save')}</Button></div><p className="text-xs text-muted-foreground">- Get a key from{' '}- <a- href="https://console.anthropic.com/settings/keys"- target="_blank"- rel="noreferrer"- className="underline"- >- console.anthropic.com- </a>- . The key is encrypted at rest; Ansvisor support cannot read it.+ {t.rich('agent_keyHint', {+ link: (chunks) => (+ <a+ href="https://console.anthropic.com/settings/keys"+ target="_blank"+ rel="noreferrer"+ className="underline"+ >+ {chunks}+ </a>+ ),+ })}</p></div>@@ -205,7 +204,7 @@ export function AgentSection() {) : (<Trash2 className="mr-2 h-4 w-4" />)}- Remove key+ {t('agent_removeKey')}</Button></div>)}@@ -218,11 +217,8 @@ export function AgentSection() {<div className="flex items-start gap-3 rounded-md border bg-muted/40 p-3 text-sm"><Lock className="mt-0.5 h-4 w-4 shrink-0 text-muted-foreground" /><div>- <p className="font-medium">Admin-only setting</p>- <p className="mt-1 text-muted-foreground">- Only org admins can add, replace, or remove the Anthropic API key. Ask an admin if- you need it changed.- </p>+ <p className="font-medium">{t('agent_adminOnly')}</p>+ <p className="mt-1 text-muted-foreground">{t('agent_adminOnlyHint')}</p></div></div>)}diff --git a/web/src/components/settings/api-keys-section.tsx b/web/src/components/settings/api-keys-section.tsxindex 355cba0c7..2ff5be792 100644--- a/web/src/components/settings/api-keys-section.tsx+++ b/web/src/components/settings/api-keys-section.tsx@@ -18,6 +18,7 @@ import {import { Skeleton } from '@/components/ui/skeleton';import { Badge } from '@/components/ui/badge';import { Copy, KeyRound, Loader2, Plus, Trash2 } from 'lucide-react';+import { useTranslations } from 'next-intl';interface ApiKey {id: string;@@ -45,6 +46,8 @@ function formatDate(iso: string | null): string {}export function ApiKeysSection() {+ const t = useTranslations('settings');+ const tCommon = useTranslations('common');const [keys, setKeys] = useState<ApiKey[]>([]);const [loading, setLoading] = useState(true);const [createOpen, setCreateOpen] = useState(false);@@ -125,22 +128,19 @@ export function ApiKeysSection() {<div><CardTitle className="flex items-center gap-2"><KeyRound className="h-4 w-4" />- API Keys+ {t('apiKeys_title')}</CardTitle>- <CardDescription>- Long-lived tokens for the Ansvisor MCP server and other external clients. Keys are- shown once at creation — store them somewhere safe.- </CardDescription>+ <CardDescription>{t('apiKeys_description')}</CardDescription></div><Button size="sm" onClick={() => setCreateOpen(true)} className="gap-1.5 shrink-0"><Plus className="h-4 w-4" />- New key+ {t('apiKeys_newKey')}</Button></div></CardHeader><CardContent className="space-y-3"><div className="rounded-md border bg-muted/40 p-3 text-xs space-y-1.5">- <p className="font-medium text-foreground">MCP endpoint</p>+ <p className="font-medium text-foreground">{t('apiKeys_mcpEndpoint')}</p><div className="flex items-center gap-2"><code className="flex-1 truncate font-mono">{mcpEndpoint}</code><Button@@ -153,16 +153,18 @@ export function ApiKeysSection() {</Button></div><p className="text-muted-foreground">- Paste this URL + a key below into Claude Desktop / Claude Code / Cursor. See the{' '}- <a- href="https://github.com/ansvisor/ansvisor#whats-next"- target="_blank"- rel="noreferrer"- className="underline"- >- MCP guide- </a>- .+ {t.rich('apiKeys_mcpEndpointHint', {+ link: (chunks) => (+ <a+ href="https://github.com/ansvisor/ansvisor#whats-next"+ target="_blank"+ rel="noreferrer"+ className="underline"+ >+ {chunks}+ </a>+ ),+ })}</p></div>@@ -172,9 +174,7 @@ export function ApiKeysSection() {<Skeleton className="h-12 w-full" /></div>) : keys.length === 0 ? (- <p className="text-sm text-muted-foreground py-6 text-center">- No API keys yet. Create one to connect the MCP server.- </p>+ <p className="text-sm text-muted-foreground py-6 text-center">{t('apiKeys_noKeys')}</p>) : (<div className="divide-y rounded-md border">{keys.map((k) => {@@ -186,13 +186,16 @@ export function ApiKeysSection() {<p className="text-sm font-medium truncate">{k.name}</p>{revoked && (<Badge variant="outline" className="text-[10px]">- revoked+ {t('apiKeys_revoked')}</Badge>)}</div><p className="text-xs text-muted-foreground font-mono">{k.prefix}…</p><p className="text-[11px] text-muted-foreground">- Created {formatDate(k.created_at)} · Last used {formatDate(k.last_used_at)}+ {t('apiKeys_created', {+ date: formatDate(k.created_at),+ lastUsed: formatDate(k.last_used_at),+ })}</p></div>{!revoked && (@@ -215,29 +218,27 @@ export function ApiKeysSection() {<Dialog open={createOpen} onOpenChange={setCreateOpen}><DialogContent><DialogHeader>- <DialogTitle>New API key</DialogTitle>- <DialogDescription>- Give this key a memorable name (e.g. "MCP — my laptop").- </DialogDescription>+ <DialogTitle>{t('apiKeys_newKeyTitle')}</DialogTitle>+ <DialogDescription>{t('apiKeys_newKeyDescription')}</DialogDescription></DialogHeader><div className="space-y-2 py-2">- <Label htmlFor="apiKeyName">Name</Label>+ <Label htmlFor="apiKeyName">{t('apiKeys_name')}</Label><Inputid="apiKeyName"value={newName}onChange={(e) => setNewName(e.target.value)}- placeholder="MCP — local"+ placeholder={t('apiKeys_namePlaceholder')}autoFocusdisabled={creating}/></div><DialogFooter><DialogClose render={<Button variant="outline" disabled={creating} />}>- Cancel+ {tCommon('cancel')}</DialogClose><Button onClick={handleCreate} disabled={creating || !newName.trim()}>{creating && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}- Create+ {t('apiKeys_create')}</Button></DialogFooter></DialogContent>@@ -246,10 +247,8 @@ export function ApiKeysSection() {<Dialog open={!!revealedToken} onOpenChange={(v) => !v && setRevealedToken(null)}><DialogContent><DialogHeader>- <DialogTitle>Copy your API key</DialogTitle>- <DialogDescription>- You won't be able to see this again. Store it somewhere safe.- </DialogDescription>+ <DialogTitle>{t('apiKeys_copyTitle')}</DialogTitle>+ <DialogDescription>{t('apiKeys_copyDescription')}</DialogDescription></DialogHeader><div className="space-y-2 py-2"><div className="flex items-center gap-2 rounded-md border bg-muted/40 p-2 font-mono text-xs">@@ -264,7 +263,7 @@ export function ApiKeysSection() {</div></div><DialogFooter>- <Button onClick={() => setRevealedToken(null)}>Done</Button>+ <Button onClick={() => setRevealedToken(null)}>{t('apiKeys_done')}</Button></DialogFooter></DialogContent></Dialog>diff --git a/web/src/components/settings/integrations-section.tsx b/web/src/components/settings/integrations-section.tsxindex c23d7cbc6..25468dba2 100644--- a/web/src/components/settings/integrations-section.tsx+++ b/web/src/components/settings/integrations-section.tsx@@ -24,6 +24,7 @@ import {SelectValue,} from '@/components/ui/select';import { BarChart3, Loader2, Search, Unplug } from 'lucide-react';+import { useTranslations } from 'next-intl';import {getIntegrationStatus,connectIntegration,@@ -48,13 +49,12 @@ import { matchProperty } from '@/lib/property-match';* provider only supplies its labels and any post-connection UI of its own.*/export function IntegrationsSection() {+ const t = useTranslations('settings');return (<Card><CardHeader>- <CardTitle>Integrations</CardTitle>- <CardDescription>- Connect external data sources. Connections are shared with your whole organization.- </CardDescription>+ <CardTitle>{t('integrations')}</CardTitle>+ <CardDescription>{t('integrations_description')}</CardDescription></CardHeader><CardContent className="space-y-4"><IntegrationCard@@ -100,6 +100,7 @@ function IntegrationCard({authConfigEnv: string;children?: ReactNode;}) {+ const t = useTranslations('settings');const [status, setStatus] = useState<IntegrationStatus | null>(null);const [connecting, setConnecting] = useState(false);const [disconnecting, setDisconnecting] = useState(false);@@ -204,7 +205,7 @@ function IntegrationCard({variant="outline"className="border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400">- Connected+ {t('integrations_connected')}</Badge>)}</div>@@ -216,7 +217,7 @@ function IntegrationCard({<Skeleton className="h-8 w-24" />) : status === 'not_configured' ? (<Badge variant="outline" className="text-muted-foreground shrink-0">- Not configured+ {t('integrations_notConfigured')}</Badge>) : status === 'connected' ? (<Dialog>@@ -224,18 +225,19 @@ function IntegrationCard({render={<Button variant="outline" size="sm" className="gap-2 shrink-0" />}><Unplug className="h-3.5 w-3.5" />- Disconnect+ {t('integrations_disconnect')}</DialogTrigger><DialogContent className="sm:max-w-sm"><DialogHeader>- <DialogTitle>Disconnect {label}</DialogTitle>- <DialogDescription>- The stored connection is removed for the whole organization. You can reconnect at- any time.- </DialogDescription>+ <DialogTitle>+ {t('integrations_disconnect')} {label}+ </DialogTitle>+ <DialogDescription>{t('integrations_disconnectDescription')}</DialogDescription></DialogHeader><DialogFooter>- <DialogClose render={<Button variant="outline" />}>Cancel</DialogClose>+ <DialogClose render={<Button variant="outline" />}>+ {t('integrations_cancel')}+ </DialogClose><DialogCloserender={<Button@@ -245,7 +247,7 @@ function IntegrationCard({/>}>- Disconnect+ {t('integrations_disconnect')}</DialogClose></DialogFooter></DialogContent>@@ -258,7 +260,7 @@ function IntegrationCard({disabled={connecting}>{connecting && <Loader2 className="h-3.5 w-3.5 animate-spin" />}- {connecting ? 'Connecting…' : 'Connect'}+ {connecting ? t('integrations_connecting') : t('integrations_connect')}</Button>)}</div>@@ -320,6 +322,7 @@ function PropertyMapping({loadRows: () => Promise<BrandPropertyRow[]>;save: (brandId: string, value: string | null) => Promise<void>;}) {+ const t = useTranslations('settings');const [options, setOptions] = useState<PropertyOption[] | null>(null);const [rows, setRows] = useState<BrandPropertyRow[] | null>(null);const [loadFailed, setLoadFailed] = useState<string | null>(null);@@ -401,14 +404,14 @@ function PropertyMapping({// mapping. Search Console values are the label (a URL), but a GA4 value is a// numeric id, which would otherwise show as a bare number once picked.const selectItems = [- { value: NONE_VALUE, label: 'Not mapped' },+ { value: NONE_VALUE, label: t('integrations_notMapped') },...options.map((option) => ({ value: option.value, label: option.label })),];return (<div className="rounded-lg border p-4 space-y-3"><div className="flex items-center justify-between gap-2">- <p className="text-sm font-medium">Property mapping</p>+ <p className="text-sm font-medium">{t('integrations_propertyMapping')}</p><span className="text-xs text-muted-foreground">{mappedCount} of {rows.length} brand{rows.length !== 1 ? 's' : ''} mapped</span>@@ -428,10 +431,10 @@ function PropertyMapping({onValueChange={(v) => handlePick(row.brandId, v ?? NONE_VALUE)}><SelectTrigger className="h-8 w-64 text-xs">- <SelectValue placeholder="Select a property" />+ <SelectValue placeholder={t('integrations_selectProperty')} /></SelectTrigger><SelectContent>- <SelectItem value={NONE_VALUE}>Not mapped</SelectItem>+ <SelectItem value={NONE_VALUE}>{t('integrations_notMapped')}</SelectItem>{options.map((option) => (<SelectItem key={option.value} value={option.value}>{option.label}diff --git a/web/src/lib/dashboard-navigation.ts b/web/src/lib/dashboard-navigation.tsindex d7d832711..b2faeea78 100644--- a/web/src/lib/dashboard-navigation.ts+++ b/web/src/lib/dashboard-navigation.ts@@ -21,6 +21,19 @@ export const dashboardNavLabelKeys: Record<string, NavLabelKey> = {Reports: { namespace: 'nav', key: 'reports' },};+/** Map from the static group title string in dashboard.ts to its nav key. */+export const dashboardNavGroupKeys: Record<string, string> = {+ Analytics: 'analytics',+ Optimization: 'optimization',+};++/** Resolve a NavGroup.title to its translated label, or return the raw string+ * as a fallback so new groups surface immediately rather than silently. */+export function getDashboardNavGroupLabel(title: string, t: Translator): string {+ const key = dashboardNavGroupKeys[title];+ return key ? t(key) : title;+}+export function getDashboardNavLabel(title: string, t: Translator, tBrands: Translator): string {const label = dashboardNavLabelKeys[title];if (!label) return title;