Skip to content

feat(i18n): localize ConfigSection and ConfigScope labels (11 MessageIds)#2918

Open
gordonlu wants to merge 2 commits into
Hmbown:mainfrom
gordonlu:feat/i18n-config-section
Open

feat(i18n): localize ConfigSection and ConfigScope labels (11 MessageIds)#2918
gordonlu wants to merge 2 commits into
Hmbown:mainfrom
gordonlu:feat/i18n-config-section

Conversation

@gordonlu

@gordonlu gordonlu commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Localize the 9 ConfigSection labels (Provider, Model, Permissions, Network, Display, Composer, Sidebar, History, MCP) and 2 ConfigScope labels (SESSION, SAVED) in the config view.

Changes

  • localization.rs: Add 11 new ConfigSection* and ConfigScope* MessageId variants with translations across all 7 shipped locales (En, Ja, ZhHans, ZhHant, PtBr, Es419, Vi)
  • views/mod.rs: Update ConfigSection::label() and ConfigScope::label() to accept Locale and delegate to tr(). Update all call sites to pass locale.

Testing

  • Existing tests updated to use Locale::En explicitly where they assert section/scope labels
  • 4338/4339 tests pass (pre-existing macOS flake: legacy_sse_closed_stream_reconnects_and_retries_tool_call)
  • cargo fmt --all -- --check passes

@greptile-apps greptile-apps 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.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@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 localizes the configuration section and scope labels in the TUI views by adding corresponding message IDs and translations across multiple languages (English, Vietnamese, Chinese, Japanese, Portuguese, and Spanish). It updates ConfigScope and ConfigSection to retrieve localized labels using the current locale, and adapts the configuration view rendering and tests accordingly. The review feedback highlights an issue where filtering in non-English locales will no longer match English terms (like 'display' or 'session'). It suggests updating the filter logic to match against both the localized and English labels to preserve search usability.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +913 to +916
let section = row.section.label(self.locale).to_lowercase();
let key = row.key.to_lowercase();
let value = self.row_display_value(row).to_lowercase();
let scope = row.scope.label().to_lowercase();
let scope = row.scope.label(self.locale).to_lowercase();

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.

medium

When using a non-English locale, filtering the configuration view using English terms (such as "display" or "session") will no longer match because the section and scope labels are fully localized. Since these are common technical terms, it is highly beneficial to allow filtering by both the localized labels and their English/canonical equivalents.

We can achieve this elegantly by formatting the search strings to include both the localized and English labels.

        let section = format!("{} {}", row.section.label(self.locale), row.section.label(Locale::En)).to_lowercase();
        let key = row.key.to_lowercase();
        let value = self.row_display_value(row).to_lowercase();
        let scope = format!("{} {}", row.scope.label(self.locale), row.scope.label(Locale::En)).to_lowercase();

@greptile-apps greptile-apps 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.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@gordonlu gordonlu force-pushed the feat/i18n-config-section branch from aa8361d to d3bea72 Compare June 9, 2026 01:29

@greptile-apps greptile-apps 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.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@Hmbown

Hmbown commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Thanks @gordonlu — we merged #2891 and #2896 from your i18n batch tonight, which moved localization.rs on main, so this slice now shows as conflicting. Could you rebase it onto current main when you get a chance?

Since the slices all touch localization.rs, the smoothest path is to rebase and push them one at a time, oldest-first (#2892#2901#2918#2919#2921#2926#2929#2932#2940) — we'll merge each promptly so the next rebase stays small. Sorry for the churn; the batch is exactly the right shape and we want all of it.

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.

2 participants