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 --- // --- Config ---
const typeConfig: Record<string, { icon: typeof Globe; color: string; bgColor: string; label: string }> = { 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', label: 'Veilleur' }, 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', label: 'Chercheur' }, 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', label: 'Surveillant' }, 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', label: 'Personnalisé' }, custom: { icon: Settings, color: 'text-emerald-600 dark:text-emerald-400', bgColor: 'bg-emerald-50 dark:bg-emerald-950' },
} }
const frequencyKeys: Record<string, string> = { const frequencyKeys: Record<string, string> = {
@@ -180,7 +180,7 @@ export function AgentCard({ agent, onEdit, onRefresh, onToggle }: AgentCardProps
onClick={handleToggle} onClick={handleToggle}
disabled={isToggling} disabled={isToggling}
className="flex-shrink-0 disabled:opacity-50" 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 ${ <div className={`relative inline-flex h-5 w-9 items-center rounded-full transition-colors ${
agent.isEnabled ? 'bg-primary' : 'bg-muted-foreground/30' 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 */} {/* Footer: Next Run + Last Status */}
<div className="border-t border-border/30 grid grid-cols-2 divide-x divide-border/30"> <div className="border-t border-border/30 grid grid-cols-2 divide-x divide-border/30">
<div className="px-4 py-2.5"> <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"> <p className="text-xs font-semibold text-foreground flex items-center gap-1">
<Clock className="w-3 h-3 text-muted-foreground/60" /> <Clock className="w-3 h-3 text-muted-foreground/60" />
{nextRunLabel} {nextRunLabel}
</p> </p>
</div> </div>
<div className="px-4 py-2.5"> <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 ? ( {lastAction ? (
<span className={`inline-flex items-center gap-1.5 text-xs font-semibold ${ <span className={`inline-flex items-center gap-1.5 text-xs font-semibold ${
lastAction.status === 'success' ? 'text-emerald-600 dark:text-emerald-400' : 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 === 'success' && <CheckCircle2 className="w-3 h-3" />}
{lastAction.status === 'failure' && <XCircle 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 === 'running' && <Loader2 className="w-3 h-3 animate-spin" />}
{lastAction.status === 'success' && 'Réussi'} {lastAction.status === 'success' && t('agents.status.success')}
{lastAction.status === 'failure' && 'Échec'} {lastAction.status === 'failure' && t('agents.status.failure')}
{lastAction.status === 'running' && 'En cours'} {lastAction.status === 'running' && t('agents.status.running')}
{lastAction.status === 'pending' && 'En attente'} {lastAction.status === 'pending' && t('agents.status.pending')}
</span> </span>
) : ( ) : (
<span className="text-xs text-muted-foreground"></span> <span className="text-xs text-muted-foreground"></span>

View File

@@ -1333,7 +1333,9 @@
"success": "نجح", "success": "نجح",
"failure": "فشل", "failure": "فشل",
"running": "قيد التشغيل", "running": "قيد التشغيل",
"pending": "قيد الانتظار" "pending": "قيد الانتظار",
"nextRun": "التنفيذ التالي",
"lastStatus": "آخر حالة"
}, },
"actions": { "actions": {
"edit": "تعديل", "edit": "تعديل",

View File

@@ -1356,7 +1356,9 @@
"success": "Erfolgreich", "success": "Erfolgreich",
"failure": "Fehlgeschlagen", "failure": "Fehlgeschlagen",
"running": "Läuft", "running": "Läuft",
"pending": "Ausstehend" "pending": "Ausstehend",
"nextRun": "Nächste Ausf.",
"lastStatus": "Letzter Status"
}, },
"actions": { "actions": {
"edit": "Bearbeiten", "edit": "Bearbeiten",

View File

@@ -1381,7 +1381,9 @@
"success": "Succeeded", "success": "Succeeded",
"failure": "Failed", "failure": "Failed",
"running": "Running", "running": "Running",
"pending": "Pending" "pending": "Pending",
"nextRun": "Next run",
"lastStatus": "Last status"
}, },
"actions": { "actions": {
"edit": "Edit", "edit": "Edit",

View File

@@ -1328,7 +1328,9 @@
"success": "Exitoso", "success": "Exitoso",
"failure": "Fallido", "failure": "Fallido",
"running": "En ejecución", "running": "En ejecución",
"pending": "Pendiente" "pending": "Pendiente",
"nextRun": "Próx. ejec.",
"lastStatus": "Último estado"
}, },
"actions": { "actions": {
"edit": "Editar", "edit": "Editar",

View File

@@ -1387,7 +1387,9 @@
"success": "موفق", "success": "موفق",
"failure": "ناموفق", "failure": "ناموفق",
"running": "در حال اجرا", "running": "در حال اجرا",
"pending": "در انتظار" "pending": "در انتظار",
"nextRun": "اجرای بعدی",
"lastStatus": "آخرین وضعیت"
}, },
"actions": { "actions": {
"edit": "ویرایش", "edit": "ویرایش",

View File

@@ -1377,7 +1377,9 @@
"success": "Réussi", "success": "Réussi",
"failure": "Échoué", "failure": "Échoué",
"running": "En cours", "running": "En cours",
"pending": "En attente" "pending": "En attente",
"nextRun": "Next run",
"lastStatus": "Last status"
}, },
"actions": { "actions": {
"edit": "Modifier", "edit": "Modifier",

View File

@@ -1333,7 +1333,9 @@
"success": "सफल", "success": "सफल",
"failure": "विफल", "failure": "विफल",
"running": "चल रहा है", "running": "चल रहा है",
"pending": "लंबित" "pending": "लंबित",
"nextRun": "अगला रन",
"lastStatus": "अंतिम स्थिति"
}, },
"actions": { "actions": {
"edit": "संपादित करें", "edit": "संपादित करें",

View File

@@ -1378,7 +1378,9 @@
"success": "Riuscito", "success": "Riuscito",
"failure": "Fallito", "failure": "Fallito",
"running": "In esecuzione", "running": "In esecuzione",
"pending": "In sospeso" "pending": "In sospeso",
"nextRun": "Pross. esec.",
"lastStatus": "Ultimo stato"
}, },
"actions": { "actions": {
"edit": "Modifica", "edit": "Modifica",

View File

@@ -1356,7 +1356,9 @@
"success": "成功", "success": "成功",
"failure": "失敗", "failure": "失敗",
"running": "実行中", "running": "実行中",
"pending": "保留中" "pending": "保留中",
"nextRun": "次回実行",
"lastStatus": "最終ステータス"
}, },
"actions": { "actions": {
"edit": "編集", "edit": "編集",

View File

@@ -1333,7 +1333,9 @@
"success": "성공", "success": "성공",
"failure": "실패", "failure": "실패",
"running": "실행 중", "running": "실행 중",
"pending": "대기 중" "pending": "대기 중",
"nextRun": "다음 실행",
"lastStatus": "마지막 상태"
}, },
"actions": { "actions": {
"edit": "편집", "edit": "편집",

View File

@@ -1378,7 +1378,9 @@
"success": "Geslaagd", "success": "Geslaagd",
"failure": "Mislukt", "failure": "Mislukt",
"running": "Actief", "running": "Actief",
"pending": "In afwachting" "pending": "In afwachting",
"nextRun": "Volgende uitv.",
"lastStatus": "Laatste status"
}, },
"actions": { "actions": {
"edit": "Bewerken", "edit": "Bewerken",

View File

@@ -1400,7 +1400,9 @@
"success": "Udane", "success": "Udane",
"failure": "Nieudane", "failure": "Nieudane",
"running": "W trakcie", "running": "W trakcie",
"pending": "Oczekujące" "pending": "Oczekujące",
"nextRun": "Nast. uruch.",
"lastStatus": "Ostatni status"
}, },
"actions": { "actions": {
"edit": "Edytuj", "edit": "Edytuj",

View File

@@ -1328,7 +1328,9 @@
"success": "Bem-sucedido", "success": "Bem-sucedido",
"failure": "Falhou", "failure": "Falhou",
"running": "Em execução", "running": "Em execução",
"pending": "Pendente" "pending": "Pendente",
"nextRun": "Próx. exec.",
"lastStatus": "Último status"
}, },
"actions": { "actions": {
"edit": "Editar", "edit": "Editar",

View File

@@ -1328,7 +1328,9 @@
"success": "Успешно", "success": "Успешно",
"failure": "Сбой", "failure": "Сбой",
"running": "Выполняется", "running": "Выполняется",
"pending": "Ожидание" "pending": "Ожидание",
"nextRun": "След. запуск",
"lastStatus": "Последний статус"
}, },
"actions": { "actions": {
"edit": "Редактировать", "edit": "Редактировать",

View File

@@ -1356,7 +1356,9 @@
"success": "成功", "success": "成功",
"failure": "失败", "failure": "失败",
"running": "运行中", "running": "运行中",
"pending": "等待中" "pending": "等待中",
"nextRun": "下次运行",
"lastStatus": "最后状态"
}, },
"actions": { "actions": {
"edit": "编辑", "edit": "编辑",