From e1082e27b73cf86eaf279643fc60181585d16bd3 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Fri, 2 Jan 2026 17:36:50 +0100 Subject: [PATCH] add full retranslation button to recipe edit page Adds a button to force complete retranslation of existing recipes, bypassing the changed-field detection to retranslate all fields from scratch. --- .../edit/[name]/+page.svelte | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/routes/[recipeLang=recipeLang]/edit/[name]/+page.svelte b/src/routes/[recipeLang=recipeLang]/edit/[name]/+page.svelte index 3244f4ee..c49c32ed 100644 --- a/src/routes/[recipeLang=recipeLang]/edit/[name]/+page.svelte +++ b/src/routes/[recipeLang=recipeLang]/edit/[name]/+page.svelte @@ -156,6 +156,18 @@ }, 100); } + // Force full retranslation of entire recipe + function forceFullRetranslation() { + // Set changedFields to empty array to trigger full translation + changedFields = []; + showTranslationWorkflow = true; + + // Scroll to translation section + setTimeout(() => { + document.getElementById('translation-section')?.scrollIntoView({ behavior: 'smooth' }); + }, 100); + } + // Handle translation approval function handleTranslationApproved(event: CustomEvent) { translationData = event.detail.translatedRecipe; @@ -473,6 +485,9 @@ button.action_button{ {#if !showTranslationWorkflow}
+{#if translationData} + +{/if}
{/if}