From 278fda7d90a67615d49d623644c239c6fd1f9ab1 Mon Sep 17 00:00:00 2001 From: Marcel Raddatz Date: Thu, 9 Apr 2026 10:30:39 +0200 Subject: [PATCH] fix(planner): translate MealActionSheet button labels to German Co-Authored-By: Claude Sonnet 4.6 --- .../src/lib/planner/MealActionSheet.svelte | 8 +++---- .../src/lib/planner/MealActionSheet.test.ts | 24 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/frontend/src/lib/planner/MealActionSheet.svelte b/frontend/src/lib/planner/MealActionSheet.svelte index 9199d35..d0b6fde 100644 --- a/frontend/src/lib/planner/MealActionSheet.svelte +++ b/frontend/src/lib/planner/MealActionSheet.svelte @@ -79,7 +79,7 @@ style="width:100%;background:var(--orange-tint);border:1px solid #FBCDA4;color:var(--orange-dark);font-family:var(--font-sans);font-size:13px;font-weight:500;border-radius:var(--radius-lg);padding:12px;text-align:center;cursor:pointer" onclick={onswap} > - ↻ Swap this meal + ↻ Gericht tauschen {#if slot.recipe} @@ -87,14 +87,14 @@ href="/recipes/{slot.recipe.id}/cook" style="display:block;width:100%;background:var(--green-tint);border:1px solid var(--green-light);color:var(--green-dark);font-family:var(--font-sans);font-size:13px;font-weight:500;border-radius:var(--radius-lg);padding:12px;text-align:center;box-sizing:border-box;text-decoration:none" > - 🍳 Cook now + 🍳 Jetzt kochen - 👁 View recipe + 👁 Rezept ansehen {/if} @@ -103,7 +103,7 @@ style="width:100%;background:none;border:none;color:var(--color-text-muted);font-family:var(--font-sans);font-size:13px;text-align:center;cursor:pointer;padding:12px" onclick={oncancel} > - Cancel + Abbrechen diff --git a/frontend/src/lib/planner/MealActionSheet.test.ts b/frontend/src/lib/planner/MealActionSheet.test.ts index 399952c..6307790 100644 --- a/frontend/src/lib/planner/MealActionSheet.test.ts +++ b/frontend/src/lib/planner/MealActionSheet.test.ts @@ -30,37 +30,37 @@ describe('MealActionSheet', () => { it('renders all 4 action buttons', () => { render(MealActionSheet, { props: baseProps }); - expect(screen.getByRole('button', { name: /Swap this meal/i })).toBeTruthy(); - expect(screen.getByRole('link', { name: /Cook now/i })).toBeTruthy(); - expect(screen.getByRole('link', { name: /View recipe/i })).toBeTruthy(); - expect(screen.getByRole('button', { name: /Cancel/i })).toBeTruthy(); + expect(screen.getByRole('button', { name: /Gericht tauschen/i })).toBeTruthy(); + expect(screen.getByRole('link', { name: /Jetzt kochen/i })).toBeTruthy(); + expect(screen.getByRole('link', { name: /Rezept ansehen/i })).toBeTruthy(); + expect(screen.getByRole('button', { name: /Abbrechen/i })).toBeTruthy(); }); - it('Cook now links to the cook route', () => { + it('Jetzt kochen links to the cook route', () => { render(MealActionSheet, { props: baseProps }); - const link = screen.getByRole('link', { name: /Cook now/i }); + const link = screen.getByRole('link', { name: /Jetzt kochen/i }); expect(link.getAttribute('href')).toBe('/recipes/r1/cook'); }); - it('View recipe links to the recipe detail route', () => { + it('Rezept ansehen links to the recipe detail route', () => { render(MealActionSheet, { props: baseProps }); - const link = screen.getByRole('link', { name: /View recipe/i }); + const link = screen.getByRole('link', { name: /Rezept ansehen/i }); expect(link.getAttribute('href')).toBe('/recipes/r1'); }); - it('clicking Swap this meal calls onswap', async () => { + it('clicking Gericht tauschen calls onswap', async () => { const onswap = vi.fn(); const user = userEvent.setup(); render(MealActionSheet, { props: { ...baseProps, onswap } }); - await user.click(screen.getByRole('button', { name: /Swap this meal/i })); + await user.click(screen.getByRole('button', { name: /Gericht tauschen/i })); expect(onswap).toHaveBeenCalledOnce(); }); - it('clicking Cancel calls oncancel', async () => { + it('clicking Abbrechen calls oncancel', async () => { const oncancel = vi.fn(); const user = userEvent.setup(); render(MealActionSheet, { props: { ...baseProps, oncancel } }); - await user.click(screen.getByRole('button', { name: /Cancel/i })); + await user.click(screen.getByRole('button', { name: /Abbrechen/i })); expect(oncancel).toHaveBeenCalledOnce(); });