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:
1 parent
4cfde680aa
commit
c9b26eb4db
6 files changed
+45
-15
No files matched your search
@@ -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'
|
||||
})));
|
||||
|
||||
|
||||
Reference in new issue
Block a user