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')} />