dreaming: use i18n for phase labels and off state

Add dreaming.phase.{light,deep,rem,off} translation keys.
Replace hardcoded English literals in phase cards template.
This commit is contained in:
Dave Morin
2026-04-09 17:54:35 -10:00
committed by Vignesh
parent d1be4cec07
commit cc387edf87
2 changed files with 8 additions and 2 deletions

View File

@@ -296,6 +296,12 @@ export const en: TranslationMap = {
clearGrounded: "Clear Grounded",
working: "Working…",
},
phase: {
light: "Light",
deep: "Deep",
rem: "Rem",
off: "off",
},
stats: {
shortTerm: "Short-term",
grounded: "Grounded",

View File

@@ -583,12 +583,12 @@ function renderScene(props: DreamingProps, idle: boolean, dreamText: string) {
const phase = props.phases?.[phaseId as keyof NonNullable<typeof props.phases>];
const enabled = phase?.enabled ?? false;
const nextRun = formatPhaseNextRun(phase?.nextRunAtMs);
const label = phaseId.charAt(0).toUpperCase() + phaseId.slice(1);
const label = t(`dreaming.phase.${phaseId}` as any);
return html`
<div class="dreams__phase ${enabled ? "" : "dreams__phase--off"}">
<div class="dreams__phase-dot ${enabled ? "dreams__phase-dot--on" : ""}"></div>
<span class="dreams__phase-name">${label}</span>
<span class="dreams__phase-next">${enabled ? nextRun : "off"}</span>
<span class="dreams__phase-next">${enabled ? nextRun : t("dreaming.phase.off")}</span>
</div>
`;
})}