Repository navigation
Closed
Labels
Description
Refs: #372
Depends on: #375
Can parallel with: #376, #377, #378, #380
Context
Migrate the Kitchen Display System (embedded dashboard KDS, standalone KDS device view), Server App standalone view, and associated KDS connection hooks from useI18n() to useTranslations() from use-intl.
Global Component Migration Rules
- Use
const t = useTranslations('kds')(or relevant namespace) fromuse-intl. - Access keys via namespaced identifiers.
- Use compile-time type-safe keys verified against
AppConfig. - Do NOT remove the compatibility adapter or legacy hook in this PR. Issue refactor(i18n): remove legacy custom i18n implementation #381 owns final removal.
- Do NOT alter KDS WebSocket lifecycle, status transitions, or server synchronization logic.
Files to Migrate (12 files)
KDS Pages & Views (3 files)
frontend/src/app/(dashboard)/kds/page.tsxfrontend/src/app/kds-standalone/page.tsxfrontend/src/app/server-standalone/page.tsx
KDS Components (7 files)
frontend/src/components/kds/KdsColumn.tsxfrontend/src/components/kds/KdsHeader.tsxfrontend/src/components/kds/KdsItemModal.tsxfrontend/src/components/kds/KdsKanbanBoard.tsxfrontend/src/components/kds/KdsLoginForm.tsxfrontend/src/components/kds/KdsTabsView.tsxfrontend/src/components/kds/KdsHtmlLang.tsx(uses registry direction helper)
Hooks (2 files)
frontend/src/hooks/useKdsConnection.tsfrontend/src/hooks/useServerKdsInfo.ts
Hook Migration Guidance
useKdsConnection.ts is a React hook executed within the React component tree beneath I18nProvider. Migrate it to use useTranslations('kds') directly for its user-facing status toasts and error messages (t('statusWaiting'), t('authFailed'), t('itemMarked', { status })), ensuring stable callback references.
Ensure status label mappings in STATUS_CONFIG use typed translation keys rather than unchecked strings.
Preserve:
- Standalone KDS language inheritance via server synchronization.
- Server App language inheritance.
- Offline and local LAN resilience (zero external network dependencies).
- RTL layout mirroring for kitchen views.
What NOT to do
- Do NOT remove
frontend/src/hooks/useI18n.tsor the compatibility bridge infrontend/src/lib/i18n.ts. - Do NOT change any translation content or wording.
- Do NOT alter WebSocket reconnection timing or REST fallback logic.
Acceptance Criteria
- All 12 KDS and Server App files migrated to
useTranslations()/ registry helpers. -
useKdsConnection.tsproperly translates status transitions and error states. - Standalone KDS and Server App pages inherit tenant language correctly.
- RTL rendering verified on KDS and Server App views.
- Compatibility bridge remains operational for unmigrated batches.
Verification
npm run lint
npm run build:frontend
npm test
npm run test:rtl-kds-server-whatsapp
npm run test:kds-contract
npm run test:kds-integration
Activity
refactor(i18n): migrate KDS and Server App components to use-intl (#402)
khaira777 commentedon Aug 19, 2026
Migrated and merged via #402.
What changed
useI18n()/t()touseTranslations():(dashboard)/kds,kds-standalone,server-standalone(+ its layout), and the KDS componentsKdsColumn,KdsHeader,KdsItemModal,KdsKanbanBoard,KdsLoginForm,KdsTabsView.KdsHtmlLanganduseServerKdsInfoalready used the registry direction/language helpers and needed no change.ORDER_TYPE_LABEL_KEYS(order-types.ts) andSTATUS_CONFIG.labelKey(useKdsConnection.ts) are now exhaustively typed against use-intl leaf keys instead of unchecked dotted strings.Verification
npm run lint0 errors;tsc --noEmitclean;npm run build:frontend(25/25 routes).npm run test:rtl-kds-server-whatsapp,npm run test:translations,npm run test:locale-chunks, and the KDS backend suites — green.Acceptance criteria — all met. Epic #372 updated (5D checked).
khaira777 commentedon Aug 19, 2026
Closed — acceptance criteria met and merged in #402. Epic #372 updated.