Skip to content

Add internationalization (i18n) support to Gemini CLI #6525

@hoteye

Description

@hoteye

What would you like to be added?

Add comprehensive internationalization (i18n) support to Gemini CLI to make it accessible to non-English speaking developers worldwide.

Proposed Implementation:

  • Integrate react-i18next for translation management
  • Support language detection via GEMINI_LANG environment variable
  • Create translation framework for core UI components:
    • Help system (/help command output)
    • Error messages and dialogs
    • Shell confirmation prompts
    • Status indicators and feedback
  • Maintain full backward compatibility (English as default)
  • Enable community-contributed translations

Technical Approach:

  • Minimal performance impact through lazy loading of translation resources
  • Type-safe translation keys using TypeScript
  • Fallback mechanism to English for missing translations
  • Integration with existing React + Ink architecture

Proposed Languages (Initial):

  • English (default, no changes needed)
  • Chinese (Simplified) - Large developer community
  • Spanish - Second most spoken language globally
  • French - Strong developer community in Europe/Africa

Example Implementation:

// Before
<Text>Basics:</Text>

// After
<Text>{t('help.basics')}</Text>

Why is this needed?

  1. Global Accessibility: Gemini CLI is used by developers worldwide, but currently all UI text is hardcoded in English, creating barriers for non-English speakers.

  2. Large International User Base: Search of existing issues reveals numerous IME-related problems for CJK languages (The UI is strange when using Japanese input. #4481, Poor real-time display of Korean IME composition in Gemini CLI #3014, Bug: Chinese IME composition is not handled correctly in the CLI #5833, Korean (Hangul) input drops the last character in Gemini CLI #2797, Chinese input BUG on MacOS #2618, etc.), indicating significant international usage. These users would greatly benefit from localized UI text.

  3. Inclusive Design: Aligns with Google's commitment to inclusive design and global accessibility standards.

  4. Community Growth: Enables broader community adoption and contribution from international developers.

  5. Industry Standard: Modern CLI tools (like git, docker, npm) increasingly support internationalization.

  6. Complementary to Existing Work: This proposal would complement the ongoing IME fixes by providing localized interface text for the same international users experiencing input issues.

Additional context

Research Findings:

  • Analyzed the current codebase and identified ~197 user-facing text strings that would benefit from internationalization
  • Searched existing issues - no duplicate requests found for UI language localization
  • Current hardcoded text examples: "Basics:", "Shell mode", "Add context", error messages, confirmation dialogs

Technical Feasibility:

  • Implementation can be done incrementally without breaking existing functionality
  • React + Ink architecture already supports i18n libraries
  • Estimated implementation: 2-3 weeks for core framework + initial languages

Impact Assessment:

  • Zero breaking changes to existing functionality
  • Opt-in feature (English remains default)
  • Enables community contribution of additional languages
  • Improves accessibility for international developers

Implementation Plan:

  1. Set up i18n infrastructure with react-i18next
  2. Extract hardcoded strings to translation keys
  3. Implement language detection via environment variables
  4. Add initial language packs (Chinese, Spanish, French)
  5. Create contribution guidelines for community translations

I have signed the Google CLA and am prepared to implement this feature following the project's contribution guidelines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stalepriority/p2Important but can be addressed in a future release.workstream-rollupLabel used to tag epics and features that are associated with one of the three primary workstreams🔒 maintainer only⛔ Do not contribute. Internal roadmap item.

    Type

    No type

    Projects

    Status

    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions