i18n(photos): translate PhotoDetailModal via $_() — info panel, EXIF rows, OSM link

Adds detail_modal sub-namespace (resolution/size/date/location-resolving/
osm-link/download); reuses existing photo.* + exif.* keys for camera/
focalLength/aperture/iso/location/tags labels and unfavorite/favorite/
details/tags. Date formatter switched from 'de-DE' to get(locale) ?? 'de'.

Baselines: hardcoded 1099 → 1090 (9 cleared); missing-keys baseline unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-04-27 14:28:09 +02:00
parent 39a6f42209
commit 4857e2c962
7 changed files with 59 additions and 17 deletions

View file

@ -127,5 +127,13 @@
"confirm": "Bestätigen",
"yes": "Ja",
"no": "Nein"
},
"detail_modal": {
"resolution": "Auflösung",
"size": "Größe",
"date": "Datum",
"location_resolving": "Wird ermittelt…",
"open_in_osm": "In OpenStreetMap öffnen →",
"action_download": "Download"
}
}

View file

@ -127,5 +127,13 @@
"confirm": "Confirm",
"yes": "Yes",
"no": "No"
},
"detail_modal": {
"resolution": "Resolution",
"size": "Size",
"date": "Date",
"location_resolving": "Resolving…",
"open_in_osm": "Open in OpenStreetMap →",
"action_download": "Download"
}
}

View file

@ -127,5 +127,13 @@
"confirm": "Confirmar",
"yes": "Sí",
"no": "No"
},
"detail_modal": {
"resolution": "Resolución",
"size": "Tamaño",
"date": "Fecha",
"location_resolving": "Resolviendo…",
"open_in_osm": "Abrir en OpenStreetMap →",
"action_download": "Descargar"
}
}

View file

@ -127,5 +127,13 @@
"confirm": "Confirmer",
"yes": "Oui",
"no": "Non"
},
"detail_modal": {
"resolution": "Résolution",
"size": "Taille",
"date": "Date",
"location_resolving": "Recherche…",
"open_in_osm": "Ouvrir dans OpenStreetMap →",
"action_download": "Télécharger"
}
}

View file

@ -127,5 +127,13 @@
"confirm": "Conferma",
"yes": "Sì",
"no": "No"
},
"detail_modal": {
"resolution": "Risoluzione",
"size": "Dimensione",
"date": "Data",
"location_resolving": "Ricerca…",
"open_in_osm": "Apri in OpenStreetMap →",
"action_download": "Download"
}
}

View file

@ -1,5 +1,6 @@
<script lang="ts">
import { _ } from 'svelte-i18n';
import { _, locale } from 'svelte-i18n';
import { get } from 'svelte/store';
import type { Photo } from '$lib/modules/photos/types';
import { photoStore } from '$lib/modules/photos/stores/photos.svelte';
import { CaretRight, DownloadSimple, Heart, MapPin, X } from '@mana/shared-icons';
@ -51,7 +52,7 @@
function formatDate(date: string | Date | null | undefined) {
if (!date) return '-';
return new Date(date).toLocaleDateString('de-DE', {
return new Date(date).toLocaleDateString(get(locale) ?? 'de', {
day: '2-digit',
month: '2-digit',
year: 'numeric',
@ -83,7 +84,7 @@
{#if showInfo}
<div class="info-panel">
<div class="info-header">
<h3 class="font-medium">Details</h3>
<h3 class="font-medium">{$_('photos.photo.details')}</h3>
<button class="icon-btn" onclick={() => (showInfo = false)}>
<CaretRight size={20} />
</button>
@ -92,35 +93,35 @@
<div class="info-actions">
<button class="action-btn" class:favorited={photo.isFavorited} onclick={handleFavorite}>
<Heart size={20} />
{photo.isFavorited ? 'Favorit entfernen' : 'Favorit'}
{photo.isFavorited ? $_('photos.photo.unfavorite') : $_('photos.photo.favorite')}
</button>
<a class="action-btn" href={photo.url} download target="_blank" rel="noopener noreferrer">
<DownloadSimple size={20} />
Download
{$_('photos.detail_modal.action_download')}
</a>
</div>
<div class="info-section">
<h4 class="info-label">Auflösung</h4>
<h4 class="info-label">{$_('photos.detail_modal.resolution')}</h4>
<p class="info-value">
{photo.width && photo.height ? `${photo.width} x ${photo.height}` : '-'}
</p>
</div>
<div class="info-section">
<h4 class="info-label">Größe</h4>
<h4 class="info-label">{$_('photos.detail_modal.size')}</h4>
<p class="info-value">{formatSize(photo.size)}</p>
</div>
<div class="info-section">
<h4 class="info-label">Datum</h4>
<h4 class="info-label">{$_('photos.detail_modal.date')}</h4>
<p class="info-value">{formatDate(photo.exif?.dateTaken || photo.createdAt)}</p>
</div>
{#if photo.exif}
{#if photo.exif.cameraMake || photo.exif.cameraModel}
<div class="info-section">
<h4 class="info-label">Kamera</h4>
<h4 class="info-label">{$_('photos.exif.camera')}</h4>
<p class="info-value">
{[photo.exif.cameraMake, photo.exif.cameraModel].filter(Boolean).join(' ')}
</p>
@ -129,28 +130,28 @@
{#if photo.exif.focalLength}
<div class="info-section">
<h4 class="info-label">Brennweite</h4>
<h4 class="info-label">{$_('photos.exif.focalLength')}</h4>
<p class="info-value">{photo.exif.focalLength}</p>
</div>
{/if}
{#if photo.exif.aperture}
<div class="info-section">
<h4 class="info-label">Blende</h4>
<h4 class="info-label">{$_('photos.exif.aperture')}</h4>
<p class="info-value">f/{photo.exif.aperture}</p>
</div>
{/if}
{#if photo.exif.iso}
<div class="info-section">
<h4 class="info-label">ISO</h4>
<h4 class="info-label">{$_('photos.exif.iso')}</h4>
<p class="info-value">ISO {photo.exif.iso}</p>
</div>
{/if}
{#if photo.exif.gpsLatitude && photo.exif.gpsLongitude}
<div class="info-section">
<h4 class="info-label">Standort</h4>
<h4 class="info-label">{$_('photos.exif.location')}</h4>
{#if locationLabel}
<p class="info-value location-line">
<MapPin size={12} />
@ -164,7 +165,9 @@
</p>
{/if}
{:else}
<p class="info-value location-loading">Wird ermittelt…</p>
<p class="info-value location-loading">
{$_('photos.detail_modal.location_resolving')}
</p>
{/if}
<a
class="info-value location-map-link"
@ -172,7 +175,7 @@
target="_blank"
rel="noopener noreferrer"
>
In OpenStreetMap öffnen →
{$_('photos.detail_modal.open_in_osm')}
</a>
</div>
{/if}
@ -180,7 +183,7 @@
{#if photo.tags && photo.tags.length > 0}
<div class="info-section">
<h4 class="info-label">Tags</h4>
<h4 class="info-label">{$_('photos.photo.tags')}</h4>
<div class="flex flex-wrap gap-2">
{#each photo.tags as tag}
<TagChip name={tag.name} color={tag.color} />

View file

@ -147,7 +147,6 @@
"apps/mana/apps/web/src/lib/modules/notes/ListView.svelte": 4,
"apps/mana/apps/web/src/lib/modules/photos/components/albums/CreateAlbumModal.svelte": 3,
"apps/mana/apps/web/src/lib/modules/photos/components/filters/FilterBar.svelte": 8,
"apps/mana/apps/web/src/lib/modules/photos/components/gallery/PhotoDetailModal.svelte": 9,
"apps/mana/apps/web/src/lib/modules/photos/ListView.svelte": 4,
"apps/mana/apps/web/src/lib/modules/picture/components/ImageLightbox.svelte": 3,
"apps/mana/apps/web/src/lib/modules/picture/components/ReferenceImagePicker.svelte": 1,