diff --git a/src/lib/components/WindAreaPanel.svelte b/src/lib/components/WindAreaPanel.svelte index 8edd9b5..6541f92 100644 --- a/src/lib/components/WindAreaPanel.svelte +++ b/src/lib/components/WindAreaPanel.svelte @@ -2,6 +2,7 @@ import Icon from "@iconify/svelte"; import "$lib/iconify-offline"; import type { WindArea } from "$lib/windkarte"; + import { useTranslate, T } from "$lib/translations"; let { area, @@ -13,10 +14,12 @@ onclose: () => void; } = $props(); - const STATUS_LABEL: Record = { - rechtskraeftig: "Rechtskräftig", - entwurf_2: "2. Entwurf 2026", - entwurf_3: "3. Entwurf", + const t = useTranslate(); + + const STATUS_KEY: Record = { + rechtskraeftig: T.windkarte_status_rechtskraeftig, + entwurf_2: T.windkarte_status_entwurf_2, + entwurf_3: T.windkarte_status_entwurf_3, }; const STATUS_CLASS: Record = { rechtskraeftig: "bg-wald-100 text-wald-800", @@ -38,10 +41,6 @@ setTimeout(() => (copied = false), 2000); } - $derived: osmHref: center - ? `https://www.openstreetmap.org/?mlat=${center[0].toFixed(5)}&mlon=${center[1].toFixed(5)}#map=14/${center[0].toFixed(5)}/${center[1].toFixed(5)}` - : null; - function osmHref(c: [number, number] | null): string | null { if (!c) return null; return `https://www.openstreetmap.org/?mlat=${c[0].toFixed(5)}&mlon=${c[1].toFixed(5)}#map=14/${c[0].toFixed(5)}/${c[1].toFixed(5)}`; @@ -57,7 +56,7 @@ {area.gebiets_nr} {#if area.status} - {STATUS_LABEL[area.status] ?? area.status} + {t(STATUS_KEY[area.status] ?? area.status)} {/if} @@ -68,7 +67,7 @@ @@ -80,25 +79,25 @@
{#if area.flaeche_ha != null}
-

Fläche

+

{t(T.windkarte_label_flaeche)}

{area.flaeche_ha.toFixed(1)} ha

{/if} {#if area.anlagen_geplant != null}
-

Geplante Anlagen

+

{t(T.windkarte_label_anlagen_geplant)}

{area.anlagen_geplant}

{/if} {#if area.hoehe_max_m != null}
-

Max. Nabenhöhe

+

{t(T.windkarte_label_hoehe_max)}

{area.hoehe_max_m} m

{/if} {#if area.investor}
-

Investor / Betreiber

+

{t(T.windkarte_label_investor)}

{area.investor}

{/if} @@ -107,7 +106,7 @@ {#if area.gemeinden && area.gemeinden.length > 0}
-

Betroffene Gemeinden

+

{t(T.windkarte_label_gemeinden)}

{#each area.gemeinden as g} {g} @@ -119,7 +118,7 @@ {#if area.notizen}
-

Hinweise

+

{t(T.windkarte_label_notizen)}

{area.notizen}

{/if} @@ -131,7 +130,7 @@ class="flex items-center gap-2 rounded-lg border border-wald-300 bg-wald-50 px-4 py-3 text-sm font-medium text-wald-700 hover:bg-wald-100 transition-colors" > - Zur Stellungnahme-Vorlage + {t(T.windkarte_stellungnahme_link)} {/if} @@ -142,7 +141,7 @@ class="flex flex-1 items-center justify-center gap-1.5 rounded-lg border border-stein-200 px-2 py-2 text-xs font-medium text-stein-600 hover:bg-stein-50 transition-colors whitespace-nowrap" > - {copied ? "Kopiert!" : "Link kopieren"} + {copied ? t(T.windkarte_action_copied) : t(T.windkarte_action_copy_link)} {#if osmHref(center)} - In OSM öffnen + {t(T.windkarte_action_osm)} {/if}
diff --git a/src/lib/components/blocks/WindkarteBlock.svelte b/src/lib/components/blocks/WindkarteBlock.svelte index c18f236..91f48c5 100644 --- a/src/lib/components/blocks/WindkarteBlock.svelte +++ b/src/lib/components/blocks/WindkarteBlock.svelte @@ -5,6 +5,9 @@ import type { WindMapBlockData } from "$lib/block-types"; import type { WindArea } from "$lib/windkarte"; import WindAreaPanel from "$lib/components/WindAreaPanel.svelte"; + import { useTranslate, T } from "$lib/translations"; + + const t = useTranslate(); let { block }: { block: WindMapBlockData } = $props(); @@ -89,8 +92,8 @@