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 @@