Repository navigation
refactor(i18n): migrate settings, admin, catalog, and WhatsApp to use-intl - #404
Merged
Merged
Conversation
…-intl Phase 3 batch 5E (issue #380). Replace useI18n()/t() with useTranslations() across settings, products, addon-groups, staff, support, whatsapp, and print-test pages plus the settings dialogs and ImageUploader. ROLE/TENANT_STATUS/BUSINESS_TYPE/PAYMENT_STATUS maps are now exhaustively typed leaf keys; whatsapp status/kind/lastError/apiError dynamic keys use typed lookup maps; the settings language selector derives options from the LANGUAGES registry. No wording or logic changes; the legacy bridge remains for #381.
…ion-5e # Conflicts: # frontend/src/lib/i18n-enums.ts
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 settings, admin, catalog, staff, support, WhatsApp, and print-test pages/components from the legacy useI18n()/t() engine to useTranslations() from use-intl (issue #380, Phase 3 batch 5E of epic #372).
Files (15 + 1 infra):
Rules:
Dynamic keys (whatsapp/page.tsx):
Verification: npm run lint, npm run build:frontend, npm test, npm run test:rtl-setup-auth-settings, npm run test:translations, npm run test:locale-chunks.
What Changed
useI18ntouse-intl'suseTranslations().frontend/src/lib/i18n-enums.tsand WhatsApp status mappings to exhaustively type role, status, business type, and payment keys againstuse-intlleaf message keys instead of template-literal strings.frontend/e2e/i18n-batch-5e.spec.tsand updatedrtl-setup-auth-settings.spec.tsto verify localized rendering and language switching across the migrated surfaces.Risk Assessment
✅ Low: The changes cleanly migrate 15 frontend pages and components plus shared i18n enums to useTranslations without altering runtime behavior, business formatting, or translation contracts.
Testing
Executed targeted translation validation, RTL direction compliance suites, and end-to-end browser tests across English, Spanish, and Persian. Verified that all migrated components resolve localized keys without raw fallback tokens, correctly derive selectable language options from the LANGUAGES registry, and handle typed enum lookups. Captured 22 full-page visual screenshot artifacts across LTR and RTL locales with all checks passing.
/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-settings-en.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-settings-es.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-settings-fa.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-settings-tax-en.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-settings-payments-en.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-products-en.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-products-es.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-products-fa.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-addon-groups-en.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-addon-groups-es.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-addon-groups-fa.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-staff-en.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-staff-es.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-staff-fa.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-support-en.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-support-es.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-support-fa.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-whatsapp-en.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-whatsapp-es.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-whatsapp-fa.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-print-test-en.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-print-test-es.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M0DFPDSSXXR8V1EG3NZ1HGEC/batch-5e-print-test-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-5e.spec.ts- new test file written by agent: frontend/e2e/i18n-batch-5e.spec.tsnpm run test:translationsnpm run test:locale-chunksnpm run test:rtl-setup-auth-settingsnpm run test:rtl-kds-server-whatsappnpx playwright test frontend/e2e/i18n-batch-5e.spec.tsnpx playwright test frontend/e2e/rtl-setup-auth-settings.spec.ts✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.