fix: remove $t() calls from $derived() blocks to fix PostCSS errors

vite-plugin-svelte CSS extraction fails when $t() is used inside $derived().
This causes "[postcss] Unknown word <script" errors that appear to be cache
issues but are actually a known Svelte 5 / vite-plugin-svelte incompatibility.

Files fixed:
- DownloadButton.svelte: use titleKey pattern with function resolver
- DACSetupWizard.svelte: use labelKey pattern resolved in WizardStepper
- RemoteControlSetupGuide.svelte: use labelKey pattern
- WizardStepper.svelte: support optional labelKey with $t() in template

Also added download.* translation keys to en.json and es.json.

cc
This commit is contained in:
vicrodh committed 2026-02-04 14:05:18 -06:00
1 parent 4cfde680aa
commit c9b26eb4db
6 files changed
+45 -15

No files matched your search

+4 -2
View File
@@ -194,9 +194,11 @@
return str.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
}
const steps = $derived<Step[]>(STEPS.map((step, index) => ({
// Store labelKey instead of calling $t() in $derived - resolve in template
const steps = $derived<(Step & { labelKey: string })[]>(STEPS.map((step, index) => ({
id: step,
label: $t(`dacWizard.steps.${toCamelCase(step)}`) || step,
label: step, // fallback
labelKey: `dacWizard.steps.${toCamelCase(step)}`,
status: index === currentIndex ? 'active' : completedSteps.has(step) ? 'complete' : 'upcoming'
})));