From 2ff097b6485706078b1d9ac82b6764751bf0ca49 Mon Sep 17 00:00:00 2001 From: Knacky Date: Mon, 22 Jun 2026 00:23:03 +0200 Subject: [PATCH] fix(frontend): i18n reactive badges + aria-labels + ExportEngagementButton + noMatch (review polish) - ExportEngagementButton: full i18n (export.btn, export.btnLoading, export.aria) - Layout: aria-label nav.brandHome on brand link, nav.themeAria on theme button - SimulationList: aria-label simulation.list.rowActions on chevron button - C2TasksPanel: aria-label c2.tasks.col.expand on expand column header - ImportC2HistoryModal: aria-label common.select on select column header - MitreMatrixModal: common.collapse/expand interpolated aria-label + mitre.matrix.noMatch - fr.json: new keys common.expand/collapse/select, nav.brandHome/themeAria, export.*, simulation.list.rowActions, mitre.matrix.noMatch, c2.tasks.col.expand Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/components/C2TasksPanel.tsx | 2 +- .../src/components/ExportEngagementButton.tsx | 8 ++++--- .../src/components/ImportC2HistoryModal.tsx | 2 +- frontend/src/components/Layout.tsx | 4 ++-- frontend/src/components/MitreMatrixModal.tsx | 4 ++-- frontend/src/components/SimulationList.tsx | 2 +- frontend/src/i18n/fr.json | 21 +++++++++++++++---- .../tests/ExportEngagementButton.test.tsx | 2 +- frontend/tests/MitreMatrixModal.test.tsx | 2 +- 9 files changed, 31 insertions(+), 16 deletions(-) diff --git a/frontend/src/components/C2TasksPanel.tsx b/frontend/src/components/C2TasksPanel.tsx index 0a9e8f8..a516a0d 100644 --- a/frontend/src/components/C2TasksPanel.tsx +++ b/frontend/src/components/C2TasksPanel.tsx @@ -57,7 +57,7 @@ export function C2TasksPanel({ simulationId }: C2TasksPanelProps): JSX.Element { - diff --git a/frontend/src/components/ExportEngagementButton.tsx b/frontend/src/components/ExportEngagementButton.tsx index c3a43df..382f1f1 100644 --- a/frontend/src/components/ExportEngagementButton.tsx +++ b/frontend/src/components/ExportEngagementButton.tsx @@ -1,5 +1,6 @@ import { useEffect, useRef, useState } from 'react'; import { ChevronDown, Download } from 'lucide-react'; +import { useTranslation } from 'react-i18next'; import { downloadEngagementExport, type ExportFormat } from '@/api/exports'; import { useToast } from '@/hooks/useToast'; @@ -14,6 +15,7 @@ const FORMATS: { label: string; value: ExportFormat }[] = [ ]; export function ExportEngagementButton({ engagementId }: ExportEngagementButtonProps): JSX.Element { + const { t } = useTranslation(); const { push } = useToast(); const [open, setOpen] = useState(false); const [loading, setLoading] = useState(null); @@ -58,11 +60,11 @@ export function ExportEngagementButton({ engagementId }: ExportEngagementButtonP onClick={() => setOpen((v) => !v)} data-testid="export-btn" > - Export + {t('export.btn')}
+ {t('c2.tasks.col.task')} {t('c2.tasks.col.command')} {t('c2.tasks.col.source')}
- diff --git a/frontend/src/components/Layout.tsx b/frontend/src/components/Layout.tsx index fc0e42b..554be2e 100644 --- a/frontend/src/components/Layout.tsx +++ b/frontend/src/components/Layout.tsx @@ -43,7 +43,7 @@ export function Layout(): JSX.Element {
+ # {t('c2.tasks.col.command')} {t('c2.tasks.col.status')}