telegram link : t.me/nullifiersystem
1. Summary & Core Promise
Velo's mobile application currently has static translation files in mobile/frontend/src/i18n and a basic language toggle in mobile/frontend/src/components/LanguageSwitcher.tsx. However, the app lacks right-to-left (RTL) layout switching (e.g. for Arabic/Hebrew), localized currency formatting, missing-key fallback handlers, and real-time locale change persistence.
This feature implements a Multi-Lingual Dynamic i18n Localization Engine & RTL Layout Support System. It adds automatic document direction switching (dir="rtl" vs dir="ltr"), dynamic currency/number formatting for cash claim values, missing translation fallback logging, and local storage persistence in mobile/frontend/src/components/LanguageSwitcher.tsx.
2. Background & Architectural Risks
- UI Layout Distortion: Switching to RTL languages without dynamic CSS flexbox/grid direction flipping causes misaligned cash request buttons and Claim QR cards.
- Missing Translation Keys: Undefined translation keys rendering as raw string IDs (
claim.trancheProgress) confuse non-English users during cash claims.
3. Database Layer Specifications
Migration SQL (033_add_user_locale_preferences.sql)
ALTER TABLE provider_profiles
ADD COLUMN IF NOT EXISTS preferred_locale VARCHAR(10) NOT NULL DEFAULT 'en',
ADD COLUMN IF NOT EXISTS preferred_currency VARCHAR(5) NOT NULL DEFAULT 'USD';
4. Backend Route & Service Layer Specifications
Route: POST /api/v1/user/preferences
- Updates preferred user locale and currency format settings.
- Returns localized response payloads based on
Accept-Language headers.
5. Background Processors / Workers
(Client-Side i18next Engine & Dynamic Locale Bundle Chunk Loader)
6. Frontend / UI Component Specifications
Component: mobile/frontend/src/components/LanguageSwitcher.tsx
- Language Selector Dropdown: Supports English, Spanish, French, Arabic (RTL), and Portuguese.
- Dynamic RTL Flipping: Automatically updates
document.documentElement.dir to rtl when Arabic is selected.
- Currency Formatter: Formats cash amounts dynamically (e.g.
$50.00 USD vs 50,00 €).
7. Rigor & Test Plan
- Unit Tests (
mobile/frontend/src/i18n/__tests__/i18n.test.ts): Verify translation key fallbacks and RTL document attribute toggles.
- UI Layout Test (
LanguageSwitcher.test.tsx): Render claim card under RTL locale; assert layout elements adjust text-align and flex direction.
8. Relevant Files Inventory
New Files to Create
apps/api/src/db/migrations/033_add_user_locale_preferences.sql
mobile/frontend/src/i18n/__tests__/i18n.test.ts
mobile/frontend/src/components/__tests__/LanguageSwitcher.test.tsx
Existing Files to Modify
mobile/frontend/src/components/LanguageSwitcher.tsx
mobile/frontend/src/main.tsx
mobile/frontend/src/index.css
mobile/frontend/src/pages/ClaimQR.tsx
apps/api/src/lib/i18n.ts
9. Acceptance Criteria
10. Contributor Notes
- ⚠️ CSS Rule: ALWAYS use logical CSS properties (
margin-inline-start, padding-inline-end) instead of fixed margin-left to support RTL layouts cleanly.
telegram link : t.me/nullifiersystem
1. Summary & Core Promise
Velo's mobile application currently has static translation files in
mobile/frontend/src/i18nand a basic language toggle inmobile/frontend/src/components/LanguageSwitcher.tsx. However, the app lacks right-to-left (RTL) layout switching (e.g. for Arabic/Hebrew), localized currency formatting, missing-key fallback handlers, and real-time locale change persistence.This feature implements a Multi-Lingual Dynamic i18n Localization Engine & RTL Layout Support System. It adds automatic document direction switching (
dir="rtl"vsdir="ltr"), dynamic currency/number formatting for cash claim values, missing translation fallback logging, and local storage persistence inmobile/frontend/src/components/LanguageSwitcher.tsx.2. Background & Architectural Risks
claim.trancheProgress) confuse non-English users during cash claims.3. Database Layer Specifications
Migration SQL (
033_add_user_locale_preferences.sql)4. Backend Route & Service Layer Specifications
Route:
POST /api/v1/user/preferencesAccept-Languageheaders.5. Background Processors / Workers
(Client-Side i18next Engine & Dynamic Locale Bundle Chunk Loader)
6. Frontend / UI Component Specifications
Component:
mobile/frontend/src/components/LanguageSwitcher.tsxdocument.documentElement.dirtortlwhen Arabic is selected.$50.00 USDvs50,00 €).7. Rigor & Test Plan
mobile/frontend/src/i18n/__tests__/i18n.test.ts): Verify translation key fallbacks and RTL document attribute toggles.LanguageSwitcher.test.tsx): Render claim card under RTL locale; assert layout elements adjust text-align and flex direction.8. Relevant Files Inventory
New Files to Create
apps/api/src/db/migrations/033_add_user_locale_preferences.sqlmobile/frontend/src/i18n/__tests__/i18n.test.tsmobile/frontend/src/components/__tests__/LanguageSwitcher.test.tsxExisting Files to Modify
mobile/frontend/src/components/LanguageSwitcher.tsxmobile/frontend/src/main.tsxmobile/frontend/src/index.cssmobile/frontend/src/pages/ClaimQR.tsxapps/api/src/lib/i18n.ts9. Acceptance Criteria
dir="rtl").10. Contributor Notes
margin-inline-start,padding-inline-end) instead of fixedmargin-leftto support RTL layouts cleanly.