Skip to content

feat(i18n): localize ConfigEdit labels and default values (11 MessageIds)#2919

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

feat(i18n): localize ConfigEdit labels and default values (11 MessageIds)#2919
gordonlu wants to merge 2 commits into
Hmbown:mainfrom
gordonlu:feat/i18n-config-edit

Conversation

@gordonlu

@gordonlu gordonlu commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Localize 11 ConfigEdit-related strings including edit mode labels (Edit, Scope, Current, Hint, New), edit footer, status messages, default value placeholders, and currency suffix.

Changes

  • localization.rs: Add 11 new ConfigEdit*, ConfigRowEffective, ConfigDefault*, and ConfigUnavailable MessageId variants with translations across all 7 shipped locales
  • views/mod.rs: Replace hardcoded English strings with self.tr() / tr() calls in ConfigView editing mode, row display value formatting, and config row construction

Testing

  • Two tests updated: escape-cancels uses Locale::En; cost-currency uses localized zh-Hans assertion
  • 4339/4339 tests pass;
  • 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 various UI strings in the configuration view of the TUI application, replacing hardcoded English strings with localized messages across multiple languages. The review feedback highlights opportunities to simplify redundant Option conversions by cloning the options directly, and suggests using the imported tr function instead of its fully qualified path.

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 thread crates/tui/src/tui/views/mod.rs Outdated
Comment on lines +624 to +629
.default_model
.as_deref()
.unwrap_or("(default)")
.to_string(),
.map(|v| v.to_string())
.unwrap_or_else(|| {
tr(app.ui_locale, MessageId::ConfigDefaultValue).to_string()
}),

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

The .as_deref().map(|v| v.to_string()) conversion is redundant here because settings.default_model is already of type Option<String>. We can simplify this by cloning the Option<String> directly.

                    .default_model
                    .clone()
                    .unwrap_or_else(|| {
                        tr(app.ui_locale, MessageId::ConfigDefaultValue).to_string()
                    }),

Comment thread crates/tui/src/tui/views/mod.rs Outdated
Comment on lines +637 to +642
.reasoning_effort
.as_deref()
.unwrap_or("(config/default)")
.to_string(),
.map(|v| v.to_string())
.unwrap_or_else(|| {
tr(app.ui_locale, MessageId::ConfigDefaultReasoning).to_string()
}),

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

Similarly, settings.reasoning_effort is already of type Option<String>. We can simplify this by cloning the option directly instead of using .as_deref().map(|v| v.to_string()).

                    .reasoning_effort
                    .clone()
                    .unwrap_or_else(|| {
                        tr(app.ui_locale, MessageId::ConfigDefaultReasoning).to_string()
                    }),

Comment thread crates/tui/src/tui/views/mod.rs Outdated
let mut spans = Vec::new();
spans.push(Span::styled(
"New: ",
crate::localization::tr(locale, MessageId::ConfigEditNewLabel),

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

Since tr is already imported at the top of the file (use crate::localization::{Locale, MessageId, tr};), we can use it directly instead of using the fully qualified path crate::localization::tr.

        tr(locale, MessageId::ConfigEditNewLabel),

@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-edit branch from b149d3f to d76b396 Compare June 9, 2026 01:32

@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