small
This commit is contained in:
@@ -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).
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user