This commit is contained in:
Vincent van der Wal
2026-08-01 15:07:28 +02:00
parent 9806396476
commit 774afa6c65
45 changed files with 1515 additions and 239 deletions
+10 -7
View File
@@ -5,6 +5,9 @@
import { storedLocation } from '$lib/stores/settings';
import { routePath } from '$lib/i18n';
import * as m from '$lib/paraglide/messages';
import type { Snippet } from 'svelte';
interface Props {
@@ -29,15 +32,15 @@
// load resolves (and any weather page that doesn't carry a location).
let location = $derived($page.data.location ?? $storedLocation);
const SUBTITLES: [string, string][] = [
['/weather/week', '7-day forecast'],
['/weather/compare', 'Model comparison'],
['/weather/14-day', '14-day ensemble forecast'],
['/weather/seasonal', 'Seasonal outlook'],
['/weather/historical', 'Historical weather']
const SUBTITLES: [string, () => string][] = [
['/weather/week', m.page_week_subtitle],
['/weather/compare', m.page_compare_subtitle],
['/weather/14-day', m.page_14day_subtitle],
['/weather/seasonal', m.page_seasonal_subtitle],
['/weather/historical', m.page_historical_subtitle]
];
let subtitle = $derived(
SUBTITLES.find(([prefix]) => $page.url.pathname.startsWith(prefix))?.[1] ?? null
SUBTITLES.find(([prefix]) => routePath($page.url.pathname).startsWith(prefix))?.[1]?.() ?? null
);
</script>