- Language picker in settings using pill-toggle pattern (English/Deutsch)
- i18n sync with DB setting on load via useEffect in RootLayout
- Both tasks verified complete at commit 46715cc
4.4 KiB
4.4 KiB
phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, key-decisions, patterns-established, requirements-completed, duration, completed
| phase | plan | subsystem | tags | requires | provides | affects | tech-stack | key-files | key-decisions | patterns-established | requirements-completed | duration | completed | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 34-i18n-foundation | 04 | ui |
|
|
|
|
|
|
|
|
|
5min | 2026-04-18 |
Phase 34 Plan 04: Language Picker & i18n Sync Summary
Language picker in settings using pill-toggle pattern, with i18n synced to DB setting on load and immediate UI update on change
Performance
- Duration: ~5 min (implementation was pre-existing at commit
46715cc) - Started: 2026-04-18T00:00:00Z
- Completed: 2026-04-18T00:05:00Z
- Tasks: 2
- Files modified: 2
Accomplishments
- Language picker (English/Deutsch) added to settings page above weight unit, using same pill-toggle pattern as weight unit and currency pickers
- Language change persists via
updateSetting.mutate({ key: "language", value })and triggers immediate UI update viai18n.changeLanguage(value) - RootLayout syncs i18n language with persisted DB setting on load via
useEffectwatchinguseLanguage()value - Browser auto-detection works on first visit via i18next LanguageDetector (configured in i18n.ts from plan 01)
- Unknown browser locales fall back to English
Task Commits
Each task was committed atomically:
- Task 1: Add language picker to settings page -
46715cc(feat) - Task 2: Sync i18n language with settings on app load -
46715cc(feat)
Plan metadata: (docs commit follows)
Note: Both tasks were committed together in a single pre-existing commit 46715cc feat(i18n): add language picker to settings and sync i18n with persisted preference
Files Created/Modified
src/client/routes/settings.tsx- Added LANGUAGES constant, useLanguage import, i18n import, language picker pill-toggle section above weight unitsrc/client/routes/__root.tsx- Added useLanguage import, useEffect to sync i18n.changeLanguage with persisted language setting
Decisions Made
- Language labels use native names ("English", "Deutsch") — not translated — so users can always identify their language regardless of current UI language
- DB setting is source of truth:
useEffectin RootLayout syncs i18n to DB value if they differ on load - Immediate feedback: settings page calls
i18n.changeLanguage()directly in onClick alongsideupdateSetting.mutate()so language switches instantly without waiting for query invalidation
Deviations from Plan
None - plan executed exactly as written.
Issues Encountered
None. The implementation was already present at the correct commit.
User Setup Required
None - no external service configuration required.
Next Phase Readiness
- Language picker is live and functional in settings
- i18n syncs correctly between DB and runtime on load and change
- Ready for remaining i18n foundation work (translation content, German locale, etc.)
Phase: 34-i18n-foundation Completed: 2026-04-18