- Security Awareness Score
+ {t('simulation.security_score')}
= 70 ? 'text-tertiary' : score >= 40 ? 'text-warning' : 'text-destructive'
}`}>
@@ -191,8 +191,8 @@ export default function SimulationPlayerPage() {
{/* Progress */}
- Score {Math.round(score)}/100
- {currentNode?.type === 'end' ? 'Completed' : 'In progress'}
+ {t('simulation.score_of', { score: Math.round(score) })}
+ {currentNode?.type === 'end' ? t('simulation.status_completed') : t('simulation.status_running')}
@@ -268,7 +268,7 @@ export default function SimulationPlayerPage() {
diff --git a/frontend/src/pages/TriageInboxPage.js b/frontend/src/pages/TriageInboxPage.js
index 259899c..7e812aa 100644
--- a/frontend/src/pages/TriageInboxPage.js
+++ b/frontend/src/pages/TriageInboxPage.js
@@ -6,6 +6,7 @@ import { Badge } from '../components/ui/badge';
import PageHeader from '../components/PageHeader';
import api from '../services/api';
import { toast } from 'sonner';
+import { useTranslation } from 'react-i18next';
function Metric({ label, value, hint }) {
return (
@@ -18,6 +19,7 @@ function Metric({ label, value, hint }) {
}
export default function TriageInboxPage() {
+ const { t, i18n } = useTranslation();
const [set, setSet] = useState(null);
const [marks, setMarks] = useState({});
const [selected, setSelected] = useState(null);
@@ -29,18 +31,21 @@ export default function TriageInboxPage() {
try {
const list = (await api.get('/triage')).data;
if (!list.length) return;
- const full = (await api.get(`/triage/${list[0].id}`)).data;
+ // Prefer the set in the UI language; sets without a language are English.
+ const lang = (i18n.language || 'en').slice(0, 2);
+ const pick = list.find((x) => (x.language || 'en') === lang) || list[0];
+ const full = (await api.get(`/triage/${pick.id}`)).data;
setSet(full);
setSelected(full.items[0]?.id || null);
startRef.current = Date.now();
- } catch { toast.error('Failed to load inbox'); }
- }, []);
+ } catch { toast.error(t('triage.load_failed')); }
+ }, [i18n.language, t]);
useEffect(() => { load(); }, [load]);
useEffect(() => {
if (!set || results) return;
- const t = setInterval(() => setElapsed(Math.round((Date.now() - startRef.current) / 1000)), 1000);
- return () => clearInterval(t);
+ const timer = setInterval(() => setElapsed(Math.round((Date.now() - startRef.current) / 1000)), 1000);
+ return () => clearInterval(timer);
}, [set, results]);
const mark = (id, v) => setMarks((p) => ({ ...p, [id]: v }));
@@ -51,11 +56,11 @@ export default function TriageInboxPage() {
marks, duration_seconds: Math.round((Date.now() - startRef.current) / 1000),
});
setResults(res.data);
- } catch { toast.error('Submit failed'); }
+ } catch { toast.error(t('triage.submit_failed')); }
};
if (!set) {
- return
;
+ return
;
}
// ── Results screen ──
@@ -64,16 +69,16 @@ export default function TriageInboxPage() {
const byId = Object.fromEntries(results.results.map((r) => [r.id, r]));
return (
-
+
-
-
-
-
+
+
+
+
- {m.duration_seconds}s · criterion {m.criterion} (bias toward {m.criterion > 0 ? 'caution' : 'trust'})
+ {t('triage.criterion', { seconds: m.duration_seconds, value: m.criterion, bias: m.criterion > 0 ? t('triage.bias_caution') : t('triage.bias_trust') })}
{set.items.map((it) => {
@@ -86,11 +91,11 @@ export default function TriageInboxPage() {
{it.subject}
- {r.outcome?.replace('_', ' ')}
+ {t(`triage.outcome.${r.outcome}`, { defaultValue: r.outcome })}
{it.from}
{r.is_pretext && r.explanation && (
-
Pretext ({r.principle}): {r.explanation}
+
{t('triage.pretext', { principle: t(`principles.${r.principle}`, { defaultValue: r.principle }) })} {r.explanation}
)}
@@ -98,7 +103,7 @@ export default function TriageInboxPage() {
);
})}
-
+
);
}
@@ -109,7 +114,7 @@ export default function TriageInboxPage() {
return (
+ description={t('triage.instructions')}>
{elapsed}s
@@ -140,22 +145,22 @@ export default function TriageInboxPage() {
{current.body}
>
- ) :
Select a message.
}
+ ) :
{t('triage.select')}
}