Switches the active-workout finish button to "FINISH EARLY" /
"VORZEITIG BEENDEN" with an orange tint when any set in the workout is
still incomplete, so users can tell at a glance whether they're
wrapping up cleanly or cutting it short.
Precache:
- Service worker now precaches /fitness/workout(/active) shells (DE+EN)
on install so a fresh device can log workouts offline without first
visiting /fitness online.
- Layout-level precache adds /fitness/__data.json itself plus the
static sub-routes nutrition/meals and check-in/body-parts (DE+EN).
Unsynced workouts on history:
- History page reads the offline outbox via getQueuedSessions on mount
and merges queued sessions into the displayed list, sorted by
startTime. Duration is computed locally so the Clock stat still
shows.
- SessionCard gains an 'unsynced' prop: renders as a non-clickable
div with an orange-accent border and a CloudOff badge labelled
'Unsynced' / 'Nicht synchronisiert'.
- On window 'online', the page waits briefly for the layout's
flushQueue to drain the outbox, then re-reads the queue and calls
invalidateAll to swap unsynced placeholders for the now-saved
server sessions.
Replace lang === 'en' string ternaries on the check-in, stats, workout,
exercises, history, and stats history detail pages, plus TemplateCard,
with t.<key> lookups against the fitness dictionary. Added new keys for
toast messages, body-part counts, body-fat label, clear/measure short
labels, "edit all fields", BF chart delta prefix, calorie balance and
adherence tooltips, actual/target legend labels, daily expenditure
prefix, height/birth/weight setup hint, exercise/workout/recent labels,
"starts with", and a {n}-template "X days ago" string.
URL slug ternaries (e.g. 'check-in' / 'erfassung') remain inline since
they encode route data, not UI text.
Bump site version to 1.56.2.
The fitness UI translation table previously lived as one combined
object in fitnessI18n.ts where every entry held both languages. That
hides drift (an English string can silently disappear without TypeScript
noticing) and makes adding strings a multi-edit dance.
Split into src/lib/i18n/fitness/{de,en}.ts. de.ts is the source of
truth for the key set; en.ts uses `as const satisfies
Record<keyof typeof de, string>` so any missing English translation is
a build-time error. fitnessI18n.ts now re-exports both as a typed
table m and adds FitnessLang/FitnessKey types — the existing
t/fitnessSlugs/fitnessLabels API stays so call sites don't churn.
The strict typing immediately surfaced one real bug: t('initializing_gps')
was being called from the active workout page but the key never existed
in the dictionary, so it had been rendering the literal string
'initializing_gps' through the fallback. Added the missing key in both
locales.
Tightened BodyPartCard.labelKey and the body-parts Step JSDoc to
FitnessKey instead of plain string so card data drift catches drift at
the data site, not the call site. Two dynamic-key sites (partKeyMap
fallbacks for unmapped measurement keys) are cast pragmatically.
The 360-entry split was done by a one-shot extraction script
(scripts/split-fitness-i18n.ts) — kept for re-use against
cospendI18n.ts and calendarI18n.ts in follow-up commits.