From 092c45c835199d07caa577c40c8a671b5b0d4045 Mon Sep 17 00:00:00 2001 From: Till JS Date: Mon, 27 Apr 2026 15:02:54 +0200 Subject: [PATCH] =?UTF-8?q?i18n(places):=20translate=20views/DetailView=20?= =?UTF-8?q?via=20$=5F()=20=E2=80=94=20header,=20fields,=20sections,=20meta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Shell labels (notFound + confirmDelete + Unbenannt fallback) - Name input placeholder, map iframe title - 5 row labels (Sichtbarkeit/Kategorie/Adresse/Koordinaten/Beschreibung) + Link share row - Category options routed via $_('places.categories.' + v) — CATEGORIES constant inlined as PlaceCategory[] array - Address + address-search placeholders, Lat/Lng coords placeholders, resolve title - Tags / Letzte Besuche section labels - 4 meta-row keys with {n}/{date} interpolation; toLocaleDateString switched to get(locale) ?? 'de' Baselines: hardcoded 1033 → 1025 (8 cleared); missing-keys baseline +1 (places.categories.* dynamic key). Co-Authored-By: Claude Opus 4.7 (1M context) --- .../modules/places/views/DetailView.svelte | 82 +++++++++++-------- scripts/i18n-hardcoded-baseline.json | 1 - scripts/i18n-missing-baseline.json | 1 + 3 files changed, 49 insertions(+), 35 deletions(-) diff --git a/apps/mana/apps/web/src/lib/modules/places/views/DetailView.svelte b/apps/mana/apps/web/src/lib/modules/places/views/DetailView.svelte index 0cf7e241d..cb77f17ad 100644 --- a/apps/mana/apps/web/src/lib/modules/places/views/DetailView.svelte +++ b/apps/mana/apps/web/src/lib/modules/places/views/DetailView.svelte @@ -26,6 +26,8 @@ import { useAllTags, getTagsByIds } from '@mana/shared-stores'; import LinkedItems from '$lib/components/links/LinkedItems.svelte'; import { removeTagIdWithUndo } from '$lib/data/tag-mutations'; + import { _, locale } from 'svelte-i18n'; + import { get } from 'svelte/store'; let { navigate, params, goBack }: ViewProps = $props(); let placeId = $derived(params.placeId as string); @@ -66,14 +68,14 @@ let placeTags = $derived(getTagsByIds(allTags, detail.entity?.tagIds ?? [])); - const CATEGORIES: { value: PlaceCategory; label: string }[] = [ - { value: 'home', label: 'Zuhause' }, - { value: 'work', label: 'Arbeit' }, - { value: 'food', label: 'Essen' }, - { value: 'shopping', label: 'Einkauf' }, - { value: 'transit', label: 'Transit' }, - { value: 'leisure', label: 'Freizeit' }, - { value: 'other', label: 'Sonstiges' }, + const CATEGORY_VALUES: PlaceCategory[] = [ + 'home', + 'work', + 'food', + 'shopping', + 'transit', + 'leisure', + 'other', ]; // --- Reverse geocoding (coords → address) --- @@ -145,7 +147,7 @@ const lat = parseFloat(editLatitude); const lng = parseFloat(editLongitude); await placesStore.updatePlace(placeId, { - name: editName.trim() || 'Unbenannt', + name: editName.trim() || $_('places.detail_view.untitled'), description: editDescription.trim() || null, address: editAddress.trim() || null, category: editCategory, @@ -192,7 +194,7 @@ } function formatDate(iso: string): string { - return new Date(iso).toLocaleDateString('de', { + return new Date(iso).toLocaleDateString(get(locale) ?? 'de', { day: '2-digit', month: '2-digit', year: '2-digit', @@ -214,11 +216,11 @@ {#snippet body(place)} @@ -232,7 +234,7 @@ bind:value={editName} onfocus={detail.focus} onblur={saveField} - placeholder="Name" + placeholder={$_('places.detail_view.name_placeholder')} />