Skip to content

fix(i18n): enable Persian, resolve scoped translation keys, and add repo-native translation tooling - #412

Merged
khaira777 merged 8 commits into
mainfrom
fix/pre-381-i18n-baseline-clean
Aug 19, 2026
Merged

khaira777 merged 8 commits into
mainfrom
fix/pre-381-i18n-baseline-clean

Conversation

@khaira777

@khaira777 khaira777 commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Intent

fix(i18n): enable Persian, resolve scoped translation keys, and add repo-native translation tooling (#412)

What Changed

  • Enabled Persian (fa) as a selectable language in the registry, aligned browser language detection to match selectable locales, and added isLanguage helper validation across auth and settings.
  • Replaced hardcoded strings in setup and settings with translation keys across all supported locales (en, es, fa, pt), removed inline fallback defaults from UI components, and updated translation tests to resolve scoped useTranslations() keys and block legacy bridge imports.
  • Added scripts/i18n-add.cjs (npm run i18n:add) to scaffold new locale files from the canonical English schema and updated npm run i18n:check to include frontend TypeScript validation.

Risk Assessment

✅ Low: The changes are well-bounded, clean, and directly satisfy all i18n requirements for Persian enablement, scoped key resolution, and scaffolding tooling with robust test coverage.

Testing

Executed targeted test suites covering translation parity and scoped key extraction across all four locales (en, es, pt, fa), script validation for i18n-add with overwrite protection, RTL foundation and screen suites, locale chunk splitting for the lazy fa bundle, and the full Playwright E2E suite capturing 14 rendered screenshots across Persian and English UI surfaces.

  • Evidence: Setup Wizard Step 1 with Persian (fa) Option Rendered (local file: /Users/gurkiratkhaira/.no-mistakes/evidence/01M0E1KB5CQR7RWQHYFJTG9ZSQ/setup-step1-fa-locale-fa-option.png)
  • Evidence: Setup Wizard Step 1 RTL in Persian (fa) (local file: /Users/gurkiratkhaira/.no-mistakes/evidence/01M0E1KB5CQR7RWQHYFJTG9ZSQ/setup-step1-rtl-fa.png)
  • Evidence: Setup Wizard Step 2 Master PIN Screen RTL in Persian (fa) (local file: /Users/gurkiratkhaira/.no-mistakes/evidence/01M0E1KB5CQR7RWQHYFJTG9ZSQ/setup-step2-master-pin-rtl-fa.png)
  • Evidence: Setup Wizard Step 3 Owner Account RTL in Persian (fa) (local file: /Users/gurkiratkhaira/.no-mistakes/evidence/01M0E1KB5CQR7RWQHYFJTG9ZSQ/setup-step3-owner-account-rtl-fa.png)
  • Evidence: Settings Store Screen RTL in Persian (fa) with Active fa Locale Selector (local file: /Users/gurkiratkhaira/.no-mistakes/evidence/01M0E1KB5CQR7RWQHYFJTG9ZSQ/settings-store-rtl-fa.png)
  • Evidence: Settings Account Screen RTL in Persian (fa) (local file: /Users/gurkiratkhaira/.no-mistakes/evidence/01M0E1KB5CQR7RWQHYFJTG9ZSQ/settings-account-rtl-fa.png)
  • Evidence: Settings Taxes Screen RTL in Persian (fa) (local file: /Users/gurkiratkhaira/.no-mistakes/evidence/01M0E1KB5CQR7RWQHYFJTG9ZSQ/settings-taxes-rtl-fa.png)
  • Evidence: Settings Health Check Dialog RTL in Persian (fa) (local file: /Users/gurkiratkhaira/.no-mistakes/evidence/01M0E1KB5CQR7RWQHYFJTG9ZSQ/settings-health-check-dialog-rtl-fa.png)
  • Evidence: Login Screen RTL in Persian (fa) with LTR Island for Email (local file: /Users/gurkiratkhaira/.no-mistakes/evidence/01M0E1KB5CQR7RWQHYFJTG9ZSQ/auth-login-rtl-fa.png)
  • Evidence: Password Recovery Screen RTL in Persian (fa) with Mirrored Back Arrow (local file: /Users/gurkiratkhaira/.no-mistakes/evidence/01M0E1KB5CQR7RWQHYFJTG9ZSQ/auth-recover-rtl-fa.png)
Evidence: CLI Scaffolding Tool Transcript for i18n-add
Created frontend/src/lib/i18n/messages/xx.json from the English canonical schema.
Next steps:
1. Add a "xx" entry to frontend/src/lib/i18n/languages.ts (locale, nativeName, direction, selectable, and dynamic load()).
2. Translate every leaf in frontend/src/lib/i18n/messages/xx.json while preserving ICU arguments and tags.
3. Run npm run i18n:check before opening the PR.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • npm run test:translations
  • npx ts-node --transpile-only -P tests/tsconfig.json tests/dev-tooling-scripts.test.ts
  • npm run test:rtl-setup-auth-settings
  • npm run test:rtl-foundation
  • npm run test:rtl-dashboard-pos-common
  • npm run test:rtl-kds-server-whatsapp
  • npm run test:locale-chunks
  • EVIDENCE_DIR=/Users/gurkiratkhaira/.no-mistakes/evidence/01M0E1KB5CQR7RWQHYFJTG9ZSQ npx playwright test e2e/rtl-setup-auth-settings.spec.ts
  • node scripts/i18n-add.cjs
  • node scripts/i18n-add.cjs en
  • node scripts/i18n-add.cjs invalid-code
  • node scripts/i18n-add.cjs xx
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@greptile-apps

greptile-apps Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR enables Persian throughout the locale registry and UI, migrates affected screens to scoped translation keys, and adds repository-native locale scaffolding and validation.

  • Adds Persian locale selection, browser detection, RTL handling, and persisted-language validation.
  • Expands localized setup, settings, POS, and WhatsApp messages across all maintained locales.
  • Updates translation integrity tests to resolve scoped useTranslations() bindings and adds guarded locale scaffolding tooling.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
frontend/src/lib/i18n/languages.ts Registers Persian as a selectable RTL locale and keeps locale loading centralized.
frontend/src/components/providers/I18nProvider.tsx Aligns active-language validation and message loading with the language registry.
frontend/src/app/setup/page.tsx Exposes all selectable locales during setup and localizes newly migrated setup content.
scripts/i18n-add.cjs Adds an offline locale scaffolder with strict locale-code validation and overwrite protection.
tests/translations.test.ts Resolves literal keys from scoped translators, validates registered locale files, and blocks legacy bridge usage.

Reviews (3): Last reviewed commit: "Merge branch 'main' into fix/pre-381-i18..." | Re-trigger Greptile

Comment thread tests/translations.test.ts Resolved
@khaira777 khaira777 changed the title fix(i18n): enable Persian and add repo-native translation tooling fix(i18n): enable Persian, resolve scoped translation keys, and add repo-native translation tooling Aug 19, 2026
@khaira777
khaira777 merged commit f277e91 into main Aug 19, 2026
13 checks passed
@khaira777
khaira777 deleted the fix/pre-381-i18n-baseline-clean branch August 19, 2026 22:49
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