From 350614d6e0e4c46cb409193a481918bbcd9d8604 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 5 Jun 2026 21:29:20 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20'=F0=9F=94=84=20Neu=20=C3=BCbersetzen'?= =?UTF-8?q?=20im=20Review-Modal=20(=C3=BCberschreibt=20Zielsprachen)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ruft /pairs/:id/translate mit overwrite:true, um falsche bestehende Übersetzungen (z.B. SV) neu zu generieren, und lädt den Modal-Inhalt neu. Co-Authored-By: Claude Opus 4.8 --- src/components/PairReviewModal.jsx | 23 ++++++++++++++++++++--- src/pages/ContentCreation.jsx | 6 ++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/components/PairReviewModal.jsx b/src/components/PairReviewModal.jsx index 2c8924a..f6a90eb 100644 --- a/src/components/PairReviewModal.jsx +++ b/src/components/PairReviewModal.jsx @@ -59,13 +59,22 @@ function buildRows(content) { return rows; } -export default function PairReviewModal({ pair, content, onClose, onDone }) { - const [busy, setBusy] = useState(null); // 'review' | 'block' +export default function PairReviewModal({ pair, content, onClose, onDone, onRetranslate }) { + const [busy, setBusy] = useState(null); // 'review' | 'block' | 'retranslate' const [missing, setMissing] = useState(null); const [error, setError] = useState(null); const rows = buildRows(content); + async function handleRetranslate() { + setBusy('retranslate'); setMissing(null); setError(null); + try { + await onRetranslate(); + } catch (e) { + setError(e.message); + } finally { setBusy(null); } + } + async function handleReview() { setBusy('review'); setMissing(null); setError(null); try { @@ -129,7 +138,15 @@ export default function PairReviewModal({ pair, content, onClose, onDone }) { )} {/* Footer — Aktionen */} -
+
+ {onRetranslate && ( + + )} +