This commit is contained in:
Vincent van der Wal
2026-08-01 17:58:17 +02:00
parent 01cc6225aa
commit 578ee3c8ce
8 changed files with 1692 additions and 1639 deletions
+9 -1
View File
@@ -324,5 +324,13 @@
"page_maps_title": "Wetterkarte",
"page_week_title": "Wetter",
"search_favorite_add": "Zu Favoriten hinzufügen",
"search_favorite_remove": "Aus Favoriten entfernen"
"search_favorite_remove": "Aus Favoriten entfernen",
"supporter_price_per_month": "{amount} / Monat",
"model_best_match_hint": "Wählt automatisch das beste Modell für diesen Ort",
"model_updated": "aktualisiert {cadence}",
"cadence_every_hour": "stündlich",
"cadence_every_hours": "alle {hours} h",
"cadence_daily": "täglich",
"cadence_monthly": "monatlich",
"cadence_varies": "variiert"
}
+9 -1
View File
@@ -324,5 +324,13 @@
"page_maps_title": "Weather map",
"page_week_title": "Weather",
"search_favorite_add": "Add to favorites",
"search_favorite_remove": "Remove from favorites"
"search_favorite_remove": "Remove from favorites",
"supporter_price_per_month": "{amount} / month",
"model_best_match_hint": "Automatically picks the best model for this location",
"model_updated": "updated {cadence}",
"cadence_every_hour": "every hour",
"cadence_every_hours": "every {hours} h",
"cadence_daily": "daily",
"cadence_monthly": "monthly",
"cadence_varies": "varies"
}
+9 -1
View File
@@ -324,5 +324,13 @@
"page_maps_title": "Mapa meteorológico",
"page_week_title": "El tiempo",
"search_favorite_add": "Añadir a favoritos",
"search_favorite_remove": "Quitar de favoritos"
"search_favorite_remove": "Quitar de favoritos",
"supporter_price_per_month": "{amount} / mes",
"model_best_match_hint": "Elige automáticamente el mejor modelo para esta ubicación",
"model_updated": "actualizado {cadence}",
"cadence_every_hour": "cada hora",
"cadence_every_hours": "cada {hours} h",
"cadence_daily": "a diario",
"cadence_monthly": "cada mes",
"cadence_varies": "variable"
}
+9 -1
View File
@@ -324,5 +324,13 @@
"page_maps_title": "Carte météo",
"page_week_title": "Météo",
"search_favorite_add": "Ajouter aux favoris",
"search_favorite_remove": "Retirer des favoris"
"search_favorite_remove": "Retirer des favoris",
"supporter_price_per_month": "{amount} / mois",
"model_best_match_hint": "Choisit automatiquement le meilleur modèle pour ce lieu",
"model_updated": "mis à jour {cadence}",
"cadence_every_hour": "toutes les heures",
"cadence_every_hours": "toutes les {hours} h",
"cadence_daily": "chaque jour",
"cadence_monthly": "chaque mois",
"cadence_varies": "variable"
}
+9 -1
View File
@@ -324,5 +324,13 @@
"page_maps_title": "Mappa meteo",
"page_week_title": "Meteo",
"search_favorite_add": "Aggiungi ai preferiti",
"search_favorite_remove": "Rimuovi dai preferiti"
"search_favorite_remove": "Rimuovi dai preferiti",
"supporter_price_per_month": "{amount} / mese",
"model_best_match_hint": "Sceglie automaticamente il modello migliore per questa località",
"model_updated": "aggiornato {cadence}",
"cadence_every_hour": "ogni ora",
"cadence_every_hours": "ogni {hours} h",
"cadence_daily": "ogni giorno",
"cadence_monthly": "ogni mese",
"cadence_varies": "variabile"
}
+3 -2
View File
@@ -54,7 +54,7 @@ export function detectCurrency(): SupporterCurrency {
return 'EUR';
}
/** Display price for the paywall panel, e.g. "€3 / month" or "CHF 3 / month". */
/** Display price for the paywall panel, e.g. "€3 / month" or "CHF 3 / Monat". */
export function getSupporterPrice(): string {
// VITE_PREMIUM_PRICE is the pre-rename name, still honoured so an existing
// deployment's .env keeps working.
@@ -62,7 +62,8 @@ export function getSupporterPrice(): string {
if (configured) return configured;
const currency = detectCurrency();
const symbol = CURRENCY_SYMBOL[currency];
return currency === 'CHF' ? `${symbol} 3 / month` : `${symbol}3 / month`;
const amount = currency === 'CHF' ? `${symbol} 3` : `${symbol}3`;
return m.supporter_price_per_month({ amount });
}
/** Short, human list of what supporting unlocks (shown on the locked panel).
+2 -2
View File
@@ -1,6 +1,6 @@
import { error, redirect } from '@sveltejs/kit';
import { deLocalizeHref, localizeHref } from '$lib/paraglide/runtime';
import { deLocalizeHref, getLocale, localizeHref } from '$lib/paraglide/runtime';
import type { GeoLocation } from '$lib/stores/settings';
@@ -115,7 +115,7 @@ export async function resolveLocationFromRoute({
location = candidate;
} else {
const res = await event.fetch(
`https://geocoding-api.open-meteo.com/v1/search?name=${encodeURIComponent(urlLocationName)}&count=1&language=en&format=json`
`https://geocoding-api.open-meteo.com/v1/search?name=${encodeURIComponent(urlLocationName)}&count=1&language=${encodeURIComponent(getLocale())}&format=json`
);
if (!res.ok) error(404, 'Location not found');
const geocodingResponse = await res.json();
@@ -24,13 +24,25 @@
groups.flatMap((group) => group.models).find((mo) => mo.value === selectedModel)
);
let modelLabel = $derived(model?.label ?? selectedModel);
// The catalogue stores update cadences as English shorthand ("every 6 h");
// map the handful of forms onto messages instead of translating the data.
function updateLabel(update: string): string {
const hours = update.match(/^every (\d+) h$/);
if (hours) return m.model_updated({ cadence: m.cadence_every_hours({ hours: hours[1] }) });
const named: Record<string, () => string> = {
'every hour': m.cadence_every_hour,
daily: m.cadence_daily,
monthly: m.cadence_monthly,
varies: m.cadence_varies
};
return m.model_updated({ cadence: (named[update] ?? (() => update))() });
}
let modelMeta = $derived.by(() => {
if (model?.resolution && model.resolution !== 'varies') {
return model.update ? `${model.resolution} · updated ${model.update}` : model.resolution;
return model.update ? `${model.resolution} · ${updateLabel(model.update)}` : model.resolution;
}
return selectedModel === 'best_match'
? 'Automatically picks the best model for this location'
: '';
return selectedModel === 'best_match' ? m.model_best_match_hint() : '';
});
</script>
@@ -96,7 +108,7 @@
<span class="font-medium">{mo.label}</span>
{#if mo.resolution && mo.resolution !== 'varies'}
<span class="text-[11px] text-muted-foreground">
{mo.resolution}{mo.update ? ` · updated ${mo.update}` : ''}
{mo.resolution}{mo.update ? ` · ${updateLabel(mo.update)}` : ''}
</span>
{:else if mo.value === 'best_match'}
<span class="text-[11px] text-muted-foreground"