Skip to content

#8060: i18n (2/4) - Settings & Assets - #18182

Closed
jethac wants to merge 4 commits into
google-gemini:mainfrom
jethac:i18n-split-002
Closed

jethac wants to merge 4 commits into
google-gemini:mainfrom
jethac:i18n-split-002

Conversation

@jethac

@jethac jethac commented Feb 3, 2026 •

Copy link
Copy Markdown

Summary

This is the second of four pull requests to implement the i18n system for Gemini CLI. This PR adds the language toggle to the Settings dialog and optimizes how bundled locale files are discovered and loaded.

Stacked on PR #18171

What's Included

  • Language Settings: Integrated an experimental.language setting into the schema, allowing users to switch between "Auto", "English", and "Japanese".
  • Asset Discovery: Replaced hardcoded language lists with a dynamic scanning system that uses a manifest.json file in each locale folder to determine display names.
  • UI Performance: Implemented caching for language options to prevent flickering in the Settings dialog.
  • Namespace Refactoring: Cleaned up and expanded the set of supported i18n namespaces.

PR Stack

Pull Request Scope Status
PR #18171 Core Infrastructure & Foundation ✅ Pending
PR #18182 (This) Settings Integration & Asset Discovery 🚀 Ready
PR #18184 User Locales (~/.gemini/locales) 📋 Future
pending UI Component Migrations & Japanese Locale 📋 Future

Testing

npm run build
npm test -w packages/cli -- src/config/settings.test.ts src/i18n/index.test.ts src/ui/components/SettingsDialog.test.tsx

hoteye and others added 2 commits February 3, 2026 00:40
- Set up i18next and react-i18next infrastructure
- Extract UI strings from Help, Auth, and Settings components
- Add English locale files with proper structure
- Implement styledText utility for interpolation
- Convert Help tests to use snapshots per Jacob's feedback
- Add direct component styling verification

This is a pure refactoring with zero behavioral changes.
All tests pass and code functionality remains identical.
@jethac
jethac requested review from a team as code owners February 3, 2026 08:25
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @jethac, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request, the second in a series of four for the Gemini CLI's internationalization (i18n) system, focuses on integrating language selection into the user settings and optimizing the discovery and loading of locale-specific assets. It introduces a new experimental language setting, enhances the asset management by dynamically scanning for translation files, and improves UI responsiveness through caching. Additionally, it refines the structure of i18n namespaces and provides a robust solution for rendering styled text within translated content, laying further groundwork for a fully internationalized command-line interface.

Highlights

  • Language Settings Integration: Introduced an "experimental.language" setting in the CLI, allowing users to select "Auto", "English", or "Japanese" for the interface language.
  • Dynamic Asset Discovery: Replaced static language lists with a dynamic system that scans locale folders for "manifest.json" files to determine available languages and their display names.
  • UI Performance Optimization: Implemented caching for language options to prevent UI flickering in the Settings dialog, ensuring a smoother user experience.
  • i18n Namespace Refactoring: Cleaned up and expanded the set of supported i18n namespaces, improving the organization and maintainability of translation keys.
  • Styled Text Utility: Introduced a new utility function ("renderStyledText") to handle styled interpolations within translated strings, ensuring proper rendering of rich text in the terminal UI.
Changelog
  • docs/cli/settings.md
    • Documented the new experimental.language setting.
  • docs/get-started/configuration.md
    • Updated configuration documentation by removing several deprecated settings (ui.autoThemeSwitching, ui.terminalBackgroundPollingInterval, ui.showUserIdentity, model.disableLoopDetection, security.allowedExtensions, GOOGLE_GENAI_API_VERSION).
    • Added new settings (tools.autoAccept, tools.enableHooks, experimental.language) to the configuration documentation.
  • package-lock.json
    • Updated @babel/runtime dependency.
    • Added new dependencies for i18n: html-parse-stringify, i18next, react-i18next, and void-elements.
  • packages/cli/package.json
    • Added i18next and react-i18next as direct dependencies.
  • packages/cli/src/config/settingsSchema.ts
    • Integrated the experimental.language setting into the CLI's settings schema, using getLanguageOptions for dynamic population of available languages.
  • packages/cli/src/gemini.tsx
    • Added an early import to initialize the i18n system before other React components are rendered.
  • packages/cli/src/i18n/index.test.ts
    • Introduced comprehensive unit tests for the i18n foundation, covering basic translation functionality, namespace handling, and completeness checks for core UI elements.
  • packages/cli/src/i18n/index.ts
    • Implemented the core i18n logic, including dynamic loading of translation files, synchronous detection of available languages via manifest.json, caching of language options, system language detection, and i18next initialization.
  • packages/cli/src/i18n/locales/en/common.json
    • Added a new English translation file for common UI elements and messages.
  • packages/cli/src/i18n/locales/en/dialogs.json
    • Added a new English translation file for dialog-specific texts, such as authentication and settings.
  • packages/cli/src/i18n/locales/en/help.json
    • Added a new English translation file for help content, including sections, basic functionalities, and keyboard shortcuts.
  • packages/cli/src/i18n/locales/en/manifest.json
    • Added a manifest file for the English locale to define its display name.
  • packages/cli/src/i18n/locales/ja/manifest.json
    • Added a manifest file for the Japanese locale to define its display name.
  • packages/cli/src/ui/components/SettingsDialog.test.tsx
    • Updated test cases for SettingsDialog to reflect changes in tools settings, specifically autoAccept.
  • packages/cli/src/ui/components/SettingsDialog.tsx
    • Modified the SettingsDialog component to correctly interpret and display string settings with options as 'enum' types, improving the handling of language selection in the UI.
  • packages/cli/src/ui/utils/styledText.test.tsx
    • Added unit tests for the renderStyledText utility, verifying its ability to render styled interpolations and its error handling for mapping mismatches.
  • packages/cli/src/ui/utils/styledText.tsx
    • Created a new utility function renderStyledText to facilitate rendering of translated strings containing styled placeholders, ensuring proper display in the Ink terminal environment.
  • packages/cli/src/utils/settingsUtils.ts
    • Refined getDisplayValue to directly use definition.options for retrieving display labels, streamlining the process for settings with predefined options.
  • packages/cli/test-setup.ts
    • Modified the test setup to ensure the i18n system is initialized globally before tests run.
  • schemas/settings.schema.json
    • Updated the JSON schema to include the new experimental.language setting.
  • scripts/copy_bundle_assets.js
    • Added a new build step to copy i18n locale files into the final bundle.
Activity
  • This pull request is the second in a series of four, focusing on the integration of i18n for Settings and Assets.
  • It is explicitly stated to be "Stacked on PR #8060: i18n (1/4) - core infrastructure #18171", indicating a dependency on prior foundational work.
  • The author has provided a clear summary of the changes and a "PR Stack" table to illustrate the overall i18n implementation plan.
  • Detailed testing instructions are included, targeting specific test files related to settings, i18n, and the SettingsDialog component.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a robust internationalization (i18n) system, adding a language toggle in settings, dynamically loading locale files, and caching language options for improved UI performance. No vulnerabilities were found in the provided code changes. The implementation is of high quality, clean, well-tested, and includes a new renderStyledText utility for styled translations, with no issues of high or critical severity identified. This is a great addition to the Gemini CLI.

@jethac jethac changed the title i18n (2/4): Settings & Assets #8060: i18n (2/4) - Settings & Assets Feb 3, 2026
@jethac
jethac force-pushed the i18n-split-002 branch 2 times, most recently from b036ea3 to c095d46 Compare February 3, 2026 08:47
@gemini-cli gemini-cli Bot added the priority/p2 Important but can be addressed in a future release. label Feb 3, 2026
@jethac
jethac force-pushed the i18n-split-002 branch 5 times, most recently from aaa5c91 to 16f48d4 Compare February 3, 2026 09:40
@jethac

jethac commented Feb 3, 2026

Copy link
Copy Markdown
Author

@jacob314 as discussed, this is part 2 of the work that was on #17738

@gemini-cli

gemini-cli Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Hi there! Thank you for your contribution to Gemini CLI. We really appreciate the time and effort you've put into this pull request.

To keep our backlog manageable and ensure we're focusing on current priorities, we are closing pull requests that haven't seen maintainer activity for 30 days. Currently, the team is prioritizing work associated with 🔒 maintainer only or help wanted issues.

If you believe this change is still critical, please feel free to comment with updated details. Otherwise, we encourage contributors to focus on open issues labeled as help wanted. Thank you for your understanding!

@gemini-cli gemini-cli Bot closed this Mar 6, 2026
@sripasg sripasg added the size/xl An extra large PR label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority/p2 Important but can be addressed in a future release. size/xl An extra large PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants