#68 Internationalization (i18n) Framework for Multi-Lingual Utility Dashboard with Runtime Language Switching#70
Conversation
|
CI Failed |
|
I Implemented a runtime i18n framework supporting 8 locales (en-US, es-MX, |
|
Still fails |
…JSON bundles. Added ICU MessageFormat parsing for pluralization and complex messages (including ar/pl/ru rules). Applied RTL support by setting document.lang and document.dir and recommending logical CSS properties. Exposed t() and helpers (formatNumber, formatDate, formatCurrency) plus setLocale via a hook. Included eight locale bundles: en-US, es-MX, pt-BR, fr-FR, de-DE, ar-SA, ja-JP, zh-CN. Added extract-i18n-keys.ts to generate translation skeletons and a Playwright test for switching. Fixed lint/type issues (removed any, typed events, replaced disallowed console usage) for CI compliance.
d364495 to
104ba38
Compare
|
The E2E test was checking for the text "Idioma" (Spanish for "Language") to Fix: Updated tests/e2e/locale-switch.spec.ts to verify locale switching by Delay explanation: The initial push had a corrupted git commit message (a |
Implements a runtime-switchable internationalization (i18n) framework to
support field operators in non-Anglophone regions. The dashboard previously
only supported English; this adds 8 locales with on-demand bundle loading, RTL
layout support, and locale-aware formatting for utility-specific data.
Locales Added
en-US, es-MX, pt-BR, fr-FR, de-DE, ar-SA, ja-JP, zh-CN
What Changed
locale bundles and sets document.dir for RTL support
(Arabic, Polish, Russian CLDR rules)
formatDate(), locale, and setLocale()
strings (each ≤ 15 KB gzipped, loaded on demand)
dispatches locale changes
settings panel for runtime locale switching
delegate to Intl.NumberFormat and Intl.DateTimeFormat
generates a skeleton JSON for translators
verifies no raw translation keys are rendered
Testing
detection