Skip to content

fix(i18n): replace raw error string interpolation with localized fallbacks - #353

Merged
khaira777 merged 3 commits into
mainfrom
fix/241-localize-error-fallbacks
Aug 17, 2026
Merged

khaira777 merged 3 commits into
mainfrom
fix/241-localize-error-fallbacks

Conversation

@khaira777

Copy link
Copy Markdown
Contributor

Intent

Localize all remaining user-facing error surfaces in the frontend so customers never see raw English backend error/message strings or JS error messages. The chosen approach is 'localized fallback only': failure toasts and inline error states render a localized t() fallback instead of interpolating raw error text, with no backend reason/code changes (backend, logs, and telemetry stay English). This completes the remaining 'Still English-only' items from the Iran/Persian locale effort (#241); TaxConfigurationPanel and the server-standalone page were already localized in earlier PRs, and web-print.ts is intentionally left for Batch H. Four new i18n keys were added in en/es/pt/fa. Backend-side English error strings that are used only for logic/telemetry (e.g. KDS 'kds is disabled' regex matching, printer error telemetry) were intentionally kept.

What Changed

  • Replaced raw backend and runtime error string interpolation across frontend pages, POS components, auth views, modals, and hooks with localized t() fallback strings.
  • Added new translation keys for cloud data deletion, deletion cancellation, email verification failures, and KOT disabled status across English, Spanish, Persian, and Portuguese dictionary files.
  • Added an E2E test suite verifying localized error fallback behavior across locales and updated printer troubleshooting documentation in README.md.

Risk Assessment

✅ Low: The change safely replaces raw English error interpolation with localized fallback strings across frontend error surfaces while preserving backend logic, logging, and telemetry.

Testing

Executed automated translation integrity suites, RTL screen regressions, and Playwright end-to-end browser tests with mock backend error injections (HTTP 400/409/429/500), verifying that frontend error surfaces display localized fallbacks across en/es/pt/fa without leaking backend messages, and captured reviewer-visible screenshots into the evidence directory.

  • Evidence: Login failure localized fallback (English) (local file: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M08KC186JQ29G9DS41MZFZH4/error-login-fallback-en.png)
  • Evidence: Login failure localized fallback (Persian) (local file: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M08KC186JQ29G9DS41MZFZH4/error-login-fallback-fa.png)
  • Evidence: Login failure localized fallback (Spanish) (local file: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M08KC186JQ29G9DS41MZFZH4/error-login-fallback-es.png)
  • Evidence: Login failure localized fallback (Portuguese) (local file: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M08KC186JQ29G9DS41MZFZH4/error-login-fallback-pt.png)
  • Evidence: Login 429 lockout localized message (Persian) (local file: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M08KC186JQ29G9DS41MZFZH4/error-login-lockout-fa.png)
  • Evidence: Password recovery failure localized fallback (English) (local file: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M08KC186JQ29G9DS41MZFZH4/error-recover-pin-fallback-en.png)
  • Evidence: Password recovery failure localized fallback (Spanish) (local file: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M08KC186JQ29G9DS41MZFZH4/error-recover-pin-fallback-es.png)
  • Evidence: Password recovery failure localized fallback (Persian) (local file: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M08KC186JQ29G9DS41MZFZH4/error-recover-pin-fallback-fa.png)
  • Evidence: Settings store tab RTL layout (Persian) (local file: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M08KC186JQ29G9DS41MZFZH4/settings-store-rtl-fa.png)
  • Evidence: Settings health check dialog RTL layout (Persian) (local file: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M08KC186JQ29G9DS41MZFZH4/settings-health-check-dialog-rtl-fa.png)
  • Outcome: ⚠️ 1 info across 1 run (5m30s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 info
  • ℹ️ frontend/e2e/localize-error-fallbacks.spec.ts - new test file written by agent: frontend/e2e/localize-error-fallbacks.spec.ts
  • npm run test:translations
  • npm run test:rtl-foundation
  • npm run test:rtl-setup-auth-settings
  • npm run test:rtl-dashboard-pos-common
  • npm run test:rtl-kds-server-whatsapp
  • npm run test:currency
  • EVIDENCE_DIR=/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M08KC186JQ29G9DS41MZFZH4 npx playwright test e2e/localize-error-fallbacks.spec.ts
  • EVIDENCE_DIR=/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M08KC186JQ29G9DS41MZFZH4 npx playwright test e2e/rtl-setup-auth-settings.spec.ts
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Failure toasts and inline error states now always render a localized
t() fallback instead of interpolating raw backend error/message strings
or JS error messages. Backend, logs, and telemetry keep English.

Adds cloudDeletionFailed, cloudDeletionCancelFailed,
verificationEmailFailed, and printTest.kotDisabled keys in en/es/pt/fa.

Refs #241
@khaira777
khaira777 requested a review from itsbkm as a code owner August 17, 2026 19:41
@khaira777
khaira777 merged commit d66add4 into main Aug 17, 2026
12 checks passed
@khaira777
khaira777 deleted the fix/241-localize-error-fallbacks branch August 17, 2026 20:04
khaira777 added a commit that referenced this pull request Aug 17, 2026
* fix(i18n): localize remaining raw backend error/message surfaces

Sweep leftover user-facing English that PR #353 missed: the POS
printer support-error card (heading, body, Get help/Dismiss, queued
toast), the import success toast, the support submit toast, and the
PrinterStatus lastError string. Raw English is kept only in telemetry
payloads and detection logic, never rendered to the user.

Generated with Codebuff 🤖
Co-Authored-By: Codebuff <[email protected]>

* no-mistakes(document): Localize remaining UI error surfaces and pass lint checks

---------

Co-authored-by: Codebuff <[email protected]>
@khaira777 khaira777 self-assigned this Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant