⬅️ Back to Frontend Architecture Index

Internationalization (i18n)

1️⃣ Section Purpose

This section documents how Smart Supply Pro handles internationalization using i18next + react-i18next.

Goals: - German-first initial experience (with English fully supported) - predictable namespace structure (/locales/{{lng}}/{{ns}}.json) - compile-time safety for translation keys via resources.d.ts

2️⃣ Scope & Boundaries

Included: - i18next initialization (frontend/src/i18n/index.ts) - language detection + persistence (localStorage key i18nextLng) - namespace layout and JSON file structure under frontend/public/locales/* - TypeScript typing of namespaces/keys (frontend/src/i18n/resources.d.ts) - help-content integration (help topics map to help:* keys)

Excluded: - MUI theming and locale packs (see Theming) - Domain page behavior (see Domains)

3️⃣ High-Level Diagram

graph LR App[React App] --> T[useTranslation('')] T --> I18N[i18next instance] I18N --> Detect[Language detector] Detect --> LS[localStorage: i18nextLng] I18N --> Backend[i18next-http-backend] Backend --> JSON[public/locales/{lng}/{ns}.json]

Contents


⬅️ Back to Frontend Architecture Index