Skip to content

Implement Internationalization (i18n) Support for Global Accessibility #34

@wonderwomancode

Description

@wonderwomancode

Summary

Implement comprehensive internationalization (i18n) support to make the AlternateFutures CLI accessible to non-English speaking users worldwide. This aligns with our mission as a censorship-resistant, privacy-focused platform serving a global audience.

Current State: English-only CLI (365 strings in /locales/en.json)
Desired State: Multi-language support with auto-detection, starting with Spanish

Problem Statement

The CLI currently only supports English, which:

  • Limits accessibility for non-English speaking users (majority of world population)
  • Contradicts our mission of global censorship resistance
  • Reduces adoption in non-English speaking markets
  • Creates barriers for international developers

Success Criteria

  • Language auto-detection from system locale
  • Spanish localization complete (365 strings translated)
  • Emoji accessibility mode (--no-emoji flag)
  • Documentation for contributors to add new languages
  • All tests pass with new i18n system
  • No breaking changes to existing English users

Implementation Phases

Phase 1: Infrastructure

  • Implement detectLanguage() function (check AF_LANGUAGE env var, fall back to system LANG)
  • Update locale loading to support multiple languages
  • Implement plural handling for English and Spanish

Phase 2: Spanish Localization

  • Translate all 365 strings to Spanish
  • Create /locales/es.json and /locales/es.d.ts
  • Native speaker review for technical accuracy

Phase 3: Accessibility

  • Add --no-emoji CLI flag and NO_EMOJI env var
  • Replace emoji icons with text equivalents for screen reader compatibility
  • Terminal width detection for responsive formatting

Phase 4: Documentation & Testing

  • Create /docs/i18n.md guide
  • Update README with language support section
  • Comprehensive test coverage (40+ unit tests, 10+ integration tests)

Phase 5: Package & Release

  • Update package.json files array
  • CI/CD updates for multi-language testing
  • Beta release, then stable v0.3.0

Technical Requirements

  • No new dependencies - use existing translation infrastructure
  • Performance: <1ms language detection, <10ms locale loading
  • Bundle size increase: <50KB for Spanish locale
  • Backward compatible with English-only users

Future Languages (prioritized by demand)

  1. Portuguese (pt)
  2. French (fr)
  3. German (de)
  4. Mandarin (zh)
  5. Japanese (ja)

See .github/issues/INTERNATIONALIZATION_TICKET.md for full implementation details including code examples, test plans, and rollout strategy.

Estimate: 3 weeks (15 working days)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions