small
This commit is contained in:
+9
-1
@@ -324,5 +324,13 @@
|
|||||||
"page_maps_title": "Wetterkarte",
|
"page_maps_title": "Wetterkarte",
|
||||||
"page_week_title": "Wetter",
|
"page_week_title": "Wetter",
|
||||||
"search_favorite_add": "Zu Favoriten hinzufügen",
|
"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
@@ -324,5 +324,13 @@
|
|||||||
"page_maps_title": "Weather map",
|
"page_maps_title": "Weather map",
|
||||||
"page_week_title": "Weather",
|
"page_week_title": "Weather",
|
||||||
"search_favorite_add": "Add to favorites",
|
"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
@@ -324,5 +324,13 @@
|
|||||||
"page_maps_title": "Mapa meteorológico",
|
"page_maps_title": "Mapa meteorológico",
|
||||||
"page_week_title": "El tiempo",
|
"page_week_title": "El tiempo",
|
||||||
"search_favorite_add": "Añadir a favoritos",
|
"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
@@ -324,5 +324,13 @@
|
|||||||
"page_maps_title": "Carte météo",
|
"page_maps_title": "Carte météo",
|
||||||
"page_week_title": "Météo",
|
"page_week_title": "Météo",
|
||||||
"search_favorite_add": "Ajouter aux favoris",
|
"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
@@ -324,5 +324,13 @@
|
|||||||
"page_maps_title": "Mappa meteo",
|
"page_maps_title": "Mappa meteo",
|
||||||
"page_week_title": "Meteo",
|
"page_week_title": "Meteo",
|
||||||
"search_favorite_add": "Aggiungi ai preferiti",
|
"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"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export function detectCurrency(): SupporterCurrency {
|
|||||||
return 'EUR';
|
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 {
|
export function getSupporterPrice(): string {
|
||||||
// VITE_PREMIUM_PRICE is the pre-rename name, still honoured so an existing
|
// VITE_PREMIUM_PRICE is the pre-rename name, still honoured so an existing
|
||||||
// deployment's .env keeps working.
|
// deployment's .env keeps working.
|
||||||
@@ -62,7 +62,8 @@ export function getSupporterPrice(): string {
|
|||||||
if (configured) return configured;
|
if (configured) return configured;
|
||||||
const currency = detectCurrency();
|
const currency = detectCurrency();
|
||||||
const symbol = CURRENCY_SYMBOL[currency];
|
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).
|
/** Short, human list of what supporting unlocks (shown on the locked panel).
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { error, redirect } from '@sveltejs/kit';
|
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';
|
import type { GeoLocation } from '$lib/stores/settings';
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ export async function resolveLocationFromRoute({
|
|||||||
location = candidate;
|
location = candidate;
|
||||||
} else {
|
} else {
|
||||||
const res = await event.fetch(
|
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');
|
if (!res.ok) error(404, 'Location not found');
|
||||||
const geocodingResponse = await res.json();
|
const geocodingResponse = await res.json();
|
||||||
|
|||||||
@@ -24,13 +24,25 @@
|
|||||||
groups.flatMap((group) => group.models).find((mo) => mo.value === selectedModel)
|
groups.flatMap((group) => group.models).find((mo) => mo.value === selectedModel)
|
||||||
);
|
);
|
||||||
let modelLabel = $derived(model?.label ?? 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(() => {
|
let modelMeta = $derived.by(() => {
|
||||||
if (model?.resolution && model.resolution !== 'varies') {
|
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'
|
return selectedModel === 'best_match' ? m.model_best_match_hint() : '';
|
||||||
? 'Automatically picks the best model for this location'
|
|
||||||
: '';
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -96,7 +108,7 @@
|
|||||||
<span class="font-medium">{mo.label}</span>
|
<span class="font-medium">{mo.label}</span>
|
||||||
{#if mo.resolution && mo.resolution !== 'varies'}
|
{#if mo.resolution && mo.resolution !== 'varies'}
|
||||||
<span class="text-[11px] text-muted-foreground">
|
<span class="text-[11px] text-muted-foreground">
|
||||||
{mo.resolution}{mo.update ? ` · updated ${mo.update}` : ''}
|
{mo.resolution}{mo.update ? ` · ${updateLabel(mo.update)}` : ''}
|
||||||
</span>
|
</span>
|
||||||
{:else if mo.value === 'best_match'}
|
{:else if mo.value === 'best_match'}
|
||||||
<span class="text-[11px] text-muted-foreground"
|
<span class="text-[11px] text-muted-foreground"
|
||||||
|
|||||||
Reference in New Issue
Block a user