Skip to content

Internationalization (i18n) with On-Demand Locale Loading #100

Description

@JamesEjembi

Problem Statement

VeriNode has a global user base requiring support for multiple languages, including right-to-left scripts. Implement an i18n framework with runtime locale switching, on-demand locale JSON loading, CLDR pluralization, RTL layout support, and localized number/date/currency formatting.

Technical Bounds

  • Locales: en-US, zh-CN, ja-JP, ko-KR, ru-RU, ar-SA (RTL), es-ES, fr-FR, de-DE.
  • Translation keys: ~400 keys across all UI components.
  • Bundle size: each locale file <= 8 KB gzipped; loaded on-demand via dynamic import.
  • Pluralization: Intl.PluralRules for CLDR-compliant plural forms.
  • RTL: CSS logical properties for layout; dir="rtl" on <html> for RTL locales.
  • Number/date: Intl.NumberFormat and Intl.DateTimeFormat with locale-appropriate settings.
  • Fallback: locale -> en-US -> console.warn in development.

Steps

  1. Create locale JSON files in src/i18n/locales/{locale}.json with nested key structure.
  2. Implement I18nProvider context with useTranslation() hook returning t(key, params?).
  3. Implement dynamic import: t() triggers import(./locales/${locale}.json) on first access.
  4. Build LocaleSwitcher component: dropdown with flag icons; persist preference in localStorage.
  5. Implement IntlNumber and IntlDate components using native Intl APIs.
  6. Add RTL support: set dir attribute, audit all components for logical property usage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSLayer: UI-CoreCore UI layer architectural concernMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignOfficial Campaign | FWC26Campaign: Official Campaign | FWC26enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions