- Install react-i18next, i18next, i18next-browser-languagedetector - Create 6 English namespace JSON files from component string extraction - Initialize i18n with LanguageDetector before React rendering
6.0 KiB
6.0 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 | 01 | ui |
|
|
|
|
|
|
|
|
~30min | 2026-04-13 |
Phase 34 Plan 01: i18n Foundation Summary
react-i18next installed with 6-namespace English locale extraction and language-detector-aware initialization wired before React rendering
Performance
- Duration: ~30 min
- Started: 2026-04-13T18:00:00Z
- Completed: 2026-04-13T18:13:55Z
- Tasks: 3
- Files modified: 9
Accomplishments
- Installed i18next, react-i18next, and i18next-browser-languagedetector as production dependencies
- Extracted all hardcoded English UI strings from 50+ components into 6 namespace JSON files
- Created
src/client/lib/i18n.tswith LanguageDetector + initReactI18next initialization, fallback to "en", detection from localStorage then navigator - Added
import "./lib/i18n"as the first line insrc/client/main.tsxto initialize before any component renders
Task Commits
Each task was committed atomically:
- Task 1: Install i18n packages -
8c0fb31(feat) - Task 2: Create English locale JSON files -
8c0fb31(feat) - Task 3: Create i18n initialization module and wire into app entry point -
8c0fb31(feat)
Note: All three tasks were committed together in a single atomic commit covering the complete foundation.
Files Created/Modified
src/client/lib/i18n.ts- i18next initialization with LanguageDetector, all 6 EN/DE namespaces, language detection configsrc/client/locales/en/common.json- Shared strings: nav items, action buttons, errors, auth prompts, confirm dialogs, FAB labels, filter UIsrc/client/locales/en/collection.json- Collection page: item cards, forms, category picker, weight summary, planning view, totals barsrc/client/locales/en/threads.json- Thread list/detail, candidate cards, comparison table, create thread modal, status badgessrc/client/locales/en/setups.json- Setup list/detail, setup cards, impact preview selector, share modalsrc/client/locales/en/onboarding.json- All 5 onboarding steps: welcome, hobby picker, item browser, review, donesrc/client/locales/en/settings.json- Settings page: language, weight unit, currency, API keys, import/exportpackage.json- Added i18next, react-i18next, i18next-browser-languagedetector to dependenciessrc/client/main.tsx- Addedimport "./lib/i18n"as first import line
Decisions Made
- Language storage key is
gearbox-languagein localStorage — app-specific to avoid conflicts with other apps defaultNS: "common"so components without explicit namespace use common keys without boilerplateescapeValue: falsebecause React already escapes JSX output- 6 namespaces organized by feature domain — allows lazy loading per route in future if bundle size becomes a concern
Deviations from Plan
None - plan executed exactly as written. The implementation includes German (de) locale resources in i18n.ts because Plan 02 (German translations) was implemented in subsequent plans and the i18n.ts file was updated to include those resources. The core 34-01 deliverables (package install, EN JSON files, initialization module) match the plan specification exactly.
Issues Encountered
None.
User Setup Required
None - no external service configuration required.
Next Phase Readiness
- i18n foundation fully operational — all components can now call
useTranslation()to access translation keys - English namespace files are the source of truth for all translatable strings
- Plan 34-02 (German translations) can create
src/client/locales/de/files mirroring the English structure - Plan 34-03 (component wiring) can replace hardcoded strings with
t()calls using the established key names
Phase: 34-i18n-foundation Completed: 2026-04-13