Repository navigation
refactor(i18n): migrate orders, tables, customers, and dashboard to use-intl - #401
Merged
Merged
Conversation
…se-intl Phase 3 batch 5C (issue #378). Replace useI18n()/t() with useTranslations() across the orders, tables, customers, and dashboard pages plus OrderHistoryGrid. ORDER_STATUS_LABEL_KEYS, TABLE_STATUS_LABEL_KEYS, and ITEM_STATUS_LABEL_KEYS are now exhaustively typed leaf-key maps; dynamic order-status interpolation and the sendBillViaFlo dotted-key callback are bridged with typed adapters. No wording or logic changes; the legacy bridge remains for later batches.
This was referenced Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Migrate the order management, table management, customer management, and dashboard pages (plus the OrderHistoryGrid component) from the legacy useI18n()/t() flat-key API to use-intl useTranslations(), completing Phase 3 batch 5C (issue #378) of the i18n migration epic (#372).
Scope is exactly 6 files: orders/page.tsx, tables/page.tsx, customers/page.tsx, dashboard/page.tsx, components/orders/OrderHistoryGrid.tsx, and lib/i18n-enums.ts.
Key decisions:
orders.${order.status}as ...) replaced with a typed ORDER_STATUS_LABEL_KEYS lookup that keeps the raw-status fallback; the redundant localizeTemplate helper was removed in favor of direct ICU params (t('minutesValue', { minutes })).Constraints: no wording, logic, or behavior changes; no new dependencies or migrations; the legacy useI18n bridge and compatibility adapter must remain for unmigrated batches (its removal is owned by #381); the two e2e assertions pinning setup/fa behavior must not be altered.
What Changed
orders,tables,customers,dashboardpages, and theOrderHistoryGridcomponent from the legacyuseI18n()flat-key hook touse-intluseTranslations()with per-namespace translators and direct ICU parameter interpolation.ORDER_STATUS_LABEL_KEYS,ITEM_STATUS_LABEL_KEYS, andTABLE_STATUS_LABEL_KEYSinfrontend/src/lib/i18n-enums.tsfrom dotted string maps to exhaustively typeduse-intlleaf keys.frontend/e2e/i18n-batch-5c.spec.ts) validating English LTR and Persian RTL rendering across all migrated pages.Risk Assessment
✅ Low: The migration from legacy useI18n to use-intl across the 6 scoped files is clean, strictly conforms to the approved scope and acceptance criteria, and introduces no regressions.
Testing
Executed translation integrity suite, RTL and chunk-splitting suites, Next.js desktop export build, and dedicated Playwright E2E tests validating localized rendering in English and Persian across all 5 migrated surfaces; all checks passed cleanly and captured full-page visual evidence.
/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0D6PY3HABMDFH71W637DKE8/dashboard-en.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0D6PY3HABMDFH71W637DKE8/dashboard-fa.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0D6PY3HABMDFH71W637DKE8/orders-en.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0D6PY3HABMDFH71W637DKE8/orders-fa.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0D6PY3HABMDFH71W637DKE8/tables-en.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0D6PY3HABMDFH71W637DKE8/tables-fa.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0D6PY3HABMDFH71W637DKE8/customers-en.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0D6PY3HABMDFH71W637DKE8/customers-fa.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0D6PY3HABMDFH71W637DKE8/order-history-grid-en.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0D6PY3HABMDFH71W637DKE8/order-history-grid-fa.png)Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
frontend/e2e/i18n-batch-5c.spec.ts- new test file written by agent: frontend/e2e/i18n-batch-5c.spec.tsnpm run test:translationsnpm run test:locale-chunksnpm run test:rtl-dashboard-pos-commonnpm run test:rtl-foundationnpm run test:rtl-setup-auth-settingsnpm run test:rtl-kds-server-whatsappcd frontend && npx cross-env NEXT_BUILD_MODE=desktop npm run buildcd frontend && npx playwright test e2e/i18n-batch-5c.spec.ts✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.