From aa96cae8a0940c90a0528f3dca585ee000e2edd3 Mon Sep 17 00:00:00 2001 From: Till JS Date: Mon, 27 Apr 2026 16:08:37 +0200 Subject: [PATCH] =?UTF-8?q?i18n(wallpaper):=20translate=20WallpaperPicker?= =?UTF-8?q?=20via=20$=5F()=20=E2=80=94=20scope=20toggle,=20tabs,=20section?= =?UTF-8?q?s,=20upload,=20overlay?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds wallpaper.picker namespace covering: - Scope toggle (Alle Szenen / Nur diese Szene), Reset action - 3 tabs (Farben/Bilder/Upload) routed via labelKey on the tab data - Section labels (Empfohlen + Weitere) - "Hintergrundbilder kommen bald" placeholder for empty images tab - Upload zone (in-progress, drop, prompt, hint with formats) - Upload error templates (failed with {status}, generic fallback) - Loading gallery + "Eigene Bilder" section + delete-image title - Overlay section + Weichzeichner/Abdunklung labels - "Bild" alt fallback for media originalName Baselines: hardcoded 975 → 968 (7 cleared); missing-keys baseline unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../wallpaper/WallpaperPicker.svelte | 57 +++++++++++-------- .../src/lib/i18n/locales/wallpaper/de.json | 26 +++++++++ .../src/lib/i18n/locales/wallpaper/en.json | 26 +++++++++ .../src/lib/i18n/locales/wallpaper/es.json | 26 +++++++++ .../src/lib/i18n/locales/wallpaper/fr.json | 26 +++++++++ .../src/lib/i18n/locales/wallpaper/it.json | 26 +++++++++ scripts/i18n-hardcoded-baseline.json | 1 - 7 files changed, 163 insertions(+), 25 deletions(-) create mode 100644 apps/mana/apps/web/src/lib/i18n/locales/wallpaper/de.json create mode 100644 apps/mana/apps/web/src/lib/i18n/locales/wallpaper/en.json create mode 100644 apps/mana/apps/web/src/lib/i18n/locales/wallpaper/es.json create mode 100644 apps/mana/apps/web/src/lib/i18n/locales/wallpaper/fr.json create mode 100644 apps/mana/apps/web/src/lib/i18n/locales/wallpaper/it.json diff --git a/apps/mana/apps/web/src/lib/components/wallpaper/WallpaperPicker.svelte b/apps/mana/apps/web/src/lib/components/wallpaper/WallpaperPicker.svelte index 3602ad1de..56eea4fdc 100644 --- a/apps/mana/apps/web/src/lib/components/wallpaper/WallpaperPicker.svelte +++ b/apps/mana/apps/web/src/lib/components/wallpaper/WallpaperPicker.svelte @@ -15,6 +15,7 @@ import { wallpaperStore } from '$lib/stores/wallpaper.svelte'; import { theme } from '$lib/stores/theme'; import { workbenchScenesStore } from '$lib/stores/workbench-scenes.svelte'; + import { _ } from 'svelte-i18n'; // ── Media URL ─────────────────────────────────────────────── @@ -81,7 +82,7 @@ id: m.id, url: `${MEDIA_URL}/api/v1/media/${m.id}/file/large`, thumbUrl: `${MEDIA_URL}/api/v1/media/${m.id}/file/thumb`, - originalName: m.originalName ?? 'Bild', + originalName: m.originalName ?? $_('wallpaper.picker.alt_image'), }) ); uploadedWallpapers = items; @@ -205,7 +206,9 @@ }); if (!res.ok) { - throw new Error(`Upload fehlgeschlagen (${res.status})`); + throw new Error( + $_('wallpaper.picker.err_upload_failed', { values: { status: res.status } }) + ); } const data = await res.json(); @@ -226,7 +229,7 @@ await applyWallpaper(buildConfig({ type: 'upload', mediaId, url })); } catch (err) { - uploadError = err instanceof Error ? err.message : 'Upload fehlgeschlagen'; + uploadError = err instanceof Error ? err.message : $_('wallpaper.picker.err_upload_generic'); } finally { uploading = false; } @@ -272,11 +275,11 @@ } } - // Tab items - const tabs: { id: Tab; label: string; icon: typeof Image }[] = [ - { id: 'gradients', label: 'Farben', icon: Palette }, - { id: 'images', label: 'Bilder', icon: Image }, - { id: 'upload', label: 'Upload', icon: UploadSimple }, + // Tab items — labelKey routed through $_() at render time + const tabs: { id: Tab; labelKey: string; icon: typeof Image }[] = [ + { id: 'gradients', labelKey: 'wallpaper.picker.tab_gradients', icon: Palette }, + { id: 'images', labelKey: 'wallpaper.picker.tab_images', icon: Image }, + { id: 'upload', labelKey: 'wallpaper.picker.tab_upload', icon: UploadSimple }, ]; @@ -294,7 +297,7 @@ class:text-muted-foreground={scope !== 'global'} onclick={() => (scope = 'global')} > - Alle Szenen + {$_('wallpaper.picker.scope_global')} {:else} @@ -319,7 +322,7 @@ onclick={clearWallpaper} > - Zurücksetzen + {$_('wallpaper.picker.action_reset')} {/if} @@ -337,7 +340,7 @@ onclick={() => (activeTab = tab.id)} > - {tab.label} + {$_(tab.labelKey)} {/each} @@ -346,7 +349,7 @@ {#if activeTab === 'gradients'}

- Empfohlen + {$_('wallpaper.picker.section_recommended')} ({currentVariant})

@@ -396,7 +399,7 @@ {#if PREDEFINED_WALLPAPERS.length === 0}
-

Hintergrundbilder kommen bald

+

{$_('wallpaper.picker.images_coming_soon')}

{:else} {#if variantWallpapers.length > 0} @@ -428,7 +431,7 @@ {#if otherWallpapers.length > 0}

- Weitere + {$_('wallpaper.picker.section_others')}

{#each otherWallpapers as wp} @@ -473,13 +476,13 @@ > {#if uploading} -

Wird hochgeladen...

+

{$_('wallpaper.picker.upload_in_progress')}

{:else}

- {isDragging ? 'Hier ablegen' : 'Bild hochladen'} + {isDragging ? $_('wallpaper.picker.upload_drop') : $_('wallpaper.picker.upload_prompt')}

-

JPG, PNG, WebP — Drag & Drop oder Klick

+

{$_('wallpaper.picker.upload_hint')}

{/if}
- Lade Bilder... + {$_('wallpaper.picker.loading_gallery')}
{:else if uploadedWallpapers.length > 0}

- Eigene Bilder + {$_('wallpaper.picker.section_my_images')}

{#each uploadedWallpapers as media (media.id)} @@ -539,7 +542,7 @@