fix: replace hardcoded French strings in agent-card with i18n t() calls
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 32s

- Replace "Prochaine exéc." → t('agents.status.nextRun')
- Replace "Dernier statut" → t('agents.status.lastStatus')
- Replace "Réussi/Échec/En cours/En attente" → t('agents.status.*')
- Replace toggle title "Désactiver/Activer" → t('agents.actions.toggle*')
- Remove unused 'label' from typeConfig (already using t('agents.types.*'))
- Add nextRun/lastStatus keys to all 15 locales

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-26 21:22:29 +02:00
parent 153c921960
commit 84c8414cd8
16 changed files with 57 additions and 27 deletions

View File

@@ -51,11 +51,11 @@ interface AgentCardProps {
// --- Config ---
const typeConfig: Record<string, { icon: typeof Globe; color: string; bgColor: string; label: string }> = {
scraper: { icon: Globe, color: 'text-blue-600 dark:text-blue-400', bgColor: 'bg-blue-50 dark:bg-blue-950', label: 'Veilleur' },
researcher: { icon: Search, color: 'text-violet-600 dark:text-violet-400', bgColor: 'bg-violet-50 dark:bg-violet-950', label: 'Chercheur' },
monitor: { icon: Eye, color: 'text-amber-600 dark:text-amber-400', bgColor: 'bg-amber-50 dark:bg-amber-950', label: 'Surveillant' },
custom: { icon: Settings, color: 'text-emerald-600 dark:text-emerald-400', bgColor: 'bg-emerald-50 dark:bg-emerald-950', label: 'Personnalisé' },
const typeConfig: Record<string, { icon: typeof Globe; color: string; bgColor: string }> = {
scraper: { icon: Globe, color: 'text-blue-600 dark:text-blue-400', bgColor: 'bg-blue-50 dark:bg-blue-950' },
researcher: { icon: Search, color: 'text-violet-600 dark:text-violet-400', bgColor: 'bg-violet-50 dark:bg-violet-950' },
monitor: { icon: Eye, color: 'text-amber-600 dark:text-amber-400', bgColor: 'bg-amber-50 dark:bg-amber-950' },
custom: { icon: Settings, color: 'text-emerald-600 dark:text-emerald-400', bgColor: 'bg-emerald-50 dark:bg-emerald-950' },
}
const frequencyKeys: Record<string, string> = {
@@ -180,7 +180,7 @@ export function AgentCard({ agent, onEdit, onRefresh, onToggle }: AgentCardProps
onClick={handleToggle}
disabled={isToggling}
className="flex-shrink-0 disabled:opacity-50"
title={agent.isEnabled ? 'Désactiver' : 'Activer'}
title={agent.isEnabled ? t('agents.actions.toggleOff') : t('agents.actions.toggleOn')}
>
<div className={`relative inline-flex h-5 w-9 items-center rounded-full transition-colors ${
agent.isEnabled ? 'bg-primary' : 'bg-muted-foreground/30'
@@ -223,14 +223,14 @@ export function AgentCard({ agent, onEdit, onRefresh, onToggle }: AgentCardProps
{/* Footer: Next Run + Last Status */}
<div className="border-t border-border/30 grid grid-cols-2 divide-x divide-border/30">
<div className="px-4 py-2.5">
<p className="text-[10px] text-muted-foreground font-medium mb-0.5">Prochaine exéc.</p>
<p className="text-[10px] text-muted-foreground font-medium mb-0.5">{t('agents.status.nextRun')}</p>
<p className="text-xs font-semibold text-foreground flex items-center gap-1">
<Clock className="w-3 h-3 text-muted-foreground/60" />
{nextRunLabel}
</p>
</div>
<div className="px-4 py-2.5">
<p className="text-[10px] text-muted-foreground font-medium mb-0.5">Dernier statut</p>
<p className="text-[10px] text-muted-foreground font-medium mb-0.5">{t('agents.status.lastStatus')}</p>
{lastAction ? (
<span className={`inline-flex items-center gap-1.5 text-xs font-semibold ${
lastAction.status === 'success' ? 'text-emerald-600 dark:text-emerald-400' :
@@ -241,10 +241,10 @@ export function AgentCard({ agent, onEdit, onRefresh, onToggle }: AgentCardProps
{lastAction.status === 'success' && <CheckCircle2 className="w-3 h-3" />}
{lastAction.status === 'failure' && <XCircle className="w-3 h-3" />}
{lastAction.status === 'running' && <Loader2 className="w-3 h-3 animate-spin" />}
{lastAction.status === 'success' && 'Réussi'}
{lastAction.status === 'failure' && 'Échec'}
{lastAction.status === 'running' && 'En cours'}
{lastAction.status === 'pending' && 'En attente'}
{lastAction.status === 'success' && t('agents.status.success')}
{lastAction.status === 'failure' && t('agents.status.failure')}
{lastAction.status === 'running' && t('agents.status.running')}
{lastAction.status === 'pending' && t('agents.status.pending')}
</span>
) : (
<span className="text-xs text-muted-foreground"></span>