From 52bd6e74bd3156dd171a31d0716165cb40ad4fef Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 21 Aug 2026 18:49:34 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20retry-failed-translations=20+=20kok-l?= =?UTF-8?q?=C3=A4get=20p=C3=A5=20r=C3=A4tt=20spr=C3=A5k=20(titel,=20ingred?= =?UTF-8?q?ienser,=20valfritt)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - retry-failed-translations.ts: kör om de receptöversättningar som föll på verifieringen (skriver ut vilka + varför, köar TRANSLATE_RECIPE på nytt). Idempotent; kör tills listan är tom, publicera sedan. - Kok-läget (cooking/[id].tsx) visade svensk titel + svenska ingrediensnamn fast detalj-API:t redan levererar översatta fält. Nu title/displayName med svensk fallback (stegen var redan översatta). - "(valfritt)" var hårdkodat i kok-läget + recept-detaljen -> ny nyckel recipe.optional i alla 12 språk. Vakt + typecheck gröna. Co-Authored-By: Claude --- apps/mobile/src/app/cooking/[id].tsx | 12 ++- apps/mobile/src/app/recipe/[id].tsx | 2 +- apps/mobile/src/locales/da/common.json | 1 + apps/mobile/src/locales/de/common.json | 1 + apps/mobile/src/locales/en/common.json | 1 + apps/mobile/src/locales/es/common.json | 1 + apps/mobile/src/locales/fi/common.json | 1 + apps/mobile/src/locales/fr/common.json | 1 + apps/mobile/src/locales/it/common.json | 1 + apps/mobile/src/locales/nb/common.json | 1 + apps/mobile/src/locales/nl/common.json | 1 + apps/mobile/src/locales/pl/common.json | 1 + apps/mobile/src/locales/pt/common.json | 1 + apps/mobile/src/locales/sv/common.json | 1 + .../scripts/retry-failed-translations.ts | 97 +++++++++++++++++++ 15 files changed, 117 insertions(+), 6 deletions(-) create mode 100644 apps/worker/scripts/retry-failed-translations.ts diff --git a/apps/mobile/src/app/cooking/[id].tsx b/apps/mobile/src/app/cooking/[id].tsx index 1d10136..b7dd77e 100644 --- a/apps/mobile/src/app/cooking/[id].tsx +++ b/apps/mobile/src/app/cooking/[id].tsx @@ -29,6 +29,7 @@ import { formatQuantity } from "@/lib/units"; interface RecipeForCooking { id: string; titleSv: string; + title?: string; portions: number; steps: Array<{ id: string; @@ -42,6 +43,7 @@ interface RecipeForCooking { ingredients: Array<{ id: string; displayNameSv: string; + displayName?: string; quantity: number; unit: string; optional: boolean; @@ -110,7 +112,7 @@ export default function CookingScreen() { ✅ {t("cooked.title")} - {recipe.titleSv} + {recipe.title ?? recipe.titleSv} {t("cooked.portionsCooked")}: {portionsCooked} @@ -140,7 +142,7 @@ export default function CookingScreen() { {t("cooked.title")} - {recipe.titleSv} + {recipe.title ?? recipe.titleSv} {t("cooked.portionsCooked")}: {portionsCooked} @@ -242,7 +244,7 @@ export default function CookingScreen() {