Skip to content

feat: implement internationalization (i18n) framework support - #105

Merged
Lakes41 merged 2 commits into
Adamantine-guild:mainfrom
CyberXpert607:feat/i18n-support
Jul 29, 2026
Merged

feat: implement internationalization (i18n) framework support#105
Lakes41 merged 2 commits into
Adamantine-guild:mainfrom
CyberXpert607:feat/i18n-support

Conversation

@CyberXpert607

Copy link
Copy Markdown
Contributor

Summary

Implements #76 : Internationalization (i18n) framework support for Whitechain App with 5 languages and RTL support.

Changes Made

1. i18n Configuration

  • ✅ Supported locales: EN, ES, ZH, JA, AR
  • ✅ Middleware for locale detection (Accept-Language header + cookie)
  • ✅ Cookie persistence for user language preference
  • ✅ Fixed next.config.mjs syntax error (removed invalid i18n block)

2. Locale Files (locales/*/common.json)

  • ✅ en (English)
  • ✅ es (Spanish)
  • ✅ zh (Mandarin)
  • ✅ ja (Japanese)
  • ✅ ar (Arabic - RTL)

3. Components Updated

  • ✅ I18nProvider — Client-side i18next with RTL sync (lang + dir on <html>)
  • ✅ LanguageSwitcher — 5-language dropdown with flags and cookie persistence
  • ✅ Navbar — Already integrated with LanguageSwitcher (no changes needed)

4. RTL Support

  • ✅ CSS [dir="rtl"] rules for Arabic
  • ✅ HTML dir attribute synced with locale
  • ✅ RTL-safe dropdown layout

5. New Files Created

File Purpose
lib/i18n/index.ts Central config (locales, RTL detection)
middleware.ts Locale negotiation + cookie/header handling
locales/zh/common.json Chinese translations
locales/ja/common.json Japanese translations
locales/ar/common.json Arabic translations (RTL)

6. Modified Files

File Change
next.config.mjs Removed invalid i18n block
lib/i18n/client.ts Loads all 5 locale bundles
lib/i18n/helpers.ts Added getCurrentLocale() helper
components/I18nProvider.tsx Syncs lang + dir attributes
components/LanguageSwitcher.tsx 5-language dropdown with RTL support
locales/en/common.json Added new language labels
locales/es/common.json Added new language labels
app/globals.css RTL rules + dropdown animation

Acceptance Criteria

  • Users can switch languages seamlessly from the UI dropdown
  • All buttons, titles, error messages, and descriptions update instantly
  • Automatically detects browser language preference on initial visit
  • RTL layout support for Arabic

Related Issue

Closes #76

Checklist

  • 5 languages supported (EN, ES, ZH, JA, AR)
  • Language dropdown in UI with flags
  • Automatic browser language detection
  • RTL layout support for Arabic
  • Cookie persistence for user preference
  • Middleware for locale routing
  • All hardcoded strings extracted to JSON

- Add i18n config with 5 languages: EN, ES, ZH, JA, AR
- Add middleware for locale detection and routing
- Create locale JSON files for all languages
- Update I18nProvider and LanguageSwitcher components
- Add RTL CSS support for Arabic
- Fix next.config.mjs syntax error

Closes Adamantine-guild#76
@Lakes41
Lakes41 merged commit eaa98c7 into Adamantine-guild:main Jul 29, 2026
1 check passed
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.

Implement Internationalization (i18n) Framework Support

2 participants