Skip to content

i18n: localize mode-picker messages#2932

Open
gordonlu wants to merge 2 commits into
Hmbown:mainfrom
gordonlu:feat/i18n-mode-picker
Open

i18n: localize mode-picker messages#2932
gordonlu wants to merge 2 commits into
Hmbown:mainfrom
gordonlu:feat/i18n-mode-picker

Conversation

@gordonlu

@gordonlu gordonlu commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Localize the mode-picker modal (8 MessageIds) across all 7 shipped locales.

Strings

  • ModePickerTitle" Mode "
  • ModePickerInstruction"Choose how CodeWhale should operate:"
  • ModePickerAgentHint"Normal execution with approvals"
  • ModePickerPlanHint"Plan first before execution"
  • ModePickerYoloHint"Auto-approve; shell enabled"
  • ModePickerFooterMove"move "
  • ModePickerFooterSelect"select "
  • ModePickerFooterCancel"cancel "

Infrastructure

  • Added locale: Locale field to ModePickerView
  • Threaded locale from AppAction::OpenModePicker in ui.rs
  • Mode names (Agent/Plan/YOLO) kept English per convention

Verification

  • 3 mode-picker tests pass
  • 8 localization tests pass
  • cargo clippy: clean
  • cargo fmt --all --check: clean

- Add 8 MessageIds for ModePicker surface (title, instruction,
  mode hints, footer labels)
- Thread locale through ModePickerView::new()
- Mode names (Agent/Plan/YOLO) kept English per convention

@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 Mode Picker UI in the TUI crate. It introduces new localization keys and translations for multiple languages, updates the ModePickerView to accept and utilize the user's locale, and refactors the view to dynamically fetch localized strings instead of using hardcoded English values. The review feedback highlights that several translations in Vietnamese, Portuguese, and Spanish are too long and will be truncated on narrow terminals (under 44 columns), and provides concise, natural alternatives to ensure the UI fits correctly.

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 +2037 to +2044
MessageId::ModePickerTitle => " Chế độ ",
MessageId::ModePickerInstruction => "Chọn cách CodeWhale vận hành:",
MessageId::ModePickerAgentHint => "Thực thi bình thường với phê duyệt",
MessageId::ModePickerPlanHint => "Lập kế hoạch trước khi thực thi",
MessageId::ModePickerYoloHint => "Tự động phê duyệt; bật shell",
MessageId::ModePickerFooterMove => "di chuyển ",
MessageId::ModePickerFooterSelect => "chọn ",
MessageId::ModePickerFooterCancel => "hủy ",

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 Vietnamese translation for the YOLO hint (ModePickerYoloHint) is slightly too long.

When the terminal is narrow, the mode picker popup is constrained to its minimum width of 44 columns (inner width of 40 columns).

  • The YOLO hint (Tự động phê duyệt; bật shell) is 29 characters. Combined with the prefix (> 3. YOLO ), the total line width is 41 characters, which exceeds the 40-character inner width and will be truncated by 1 character.

We can optimize this translation to be more concise and natural while fitting perfectly within the 40-character inner width:

  • Use "Tự động duyệt; bật shell" (25 chars) for the YOLO hint.
Suggested change
MessageId::ModePickerTitle => " Chế độ ",
MessageId::ModePickerInstruction => "Chọn cách CodeWhale vận hành:",
MessageId::ModePickerAgentHint => "Thực thi bình thường với phê duyệt",
MessageId::ModePickerPlanHint => "Lập kế hoạch trước khi thực thi",
MessageId::ModePickerYoloHint => "Tự động phê duyệt; bật shell",
MessageId::ModePickerFooterMove => "di chuyển ",
MessageId::ModePickerFooterSelect => "chọn ",
MessageId::ModePickerFooterCancel => "hủy ",
MessageId::ModePickerTitle => " Chế độ ",
MessageId::ModePickerInstruction => "Chọn cách CodeWhale vận hành:",
MessageId::ModePickerAgentHint => "Thực thi bình thường với phê duyệt",
MessageId::ModePickerPlanHint => "Lập kế hoạch trước khi thực thi",
MessageId::ModePickerYoloHint => "Tự động duyệt; bật shell",
MessageId::ModePickerFooterMove => "di chuyển ",
MessageId::ModePickerFooterSelect => "chọn ",
MessageId::ModePickerFooterCancel => "hủy ",

Comment thread crates/tui/src/localization.rs Outdated
Comment on lines +3486 to +3493
MessageId::ModePickerTitle => " Modo ",
MessageId::ModePickerInstruction => "Escolha como o CodeWhale deve operar:",
MessageId::ModePickerAgentHint => "Execução normal com aprovações",
MessageId::ModePickerPlanHint => "Planejar antes de executar",
MessageId::ModePickerYoloHint => "Aprovação automática; shell ativado",
MessageId::ModePickerFooterMove => "mover ",
MessageId::ModePickerFooterSelect => "selecionar ",
MessageId::ModePickerFooterCancel => "cancelar ",

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 Portuguese translation for the YOLO hint (ModePickerYoloHint) and the footer buttons (ModePickerFooterSelect, ModePickerFooterCancel) are too long.

When the terminal is narrow, the mode picker popup is constrained to its minimum width of 44 columns (inner width of 40 columns).

  • The YOLO hint (Aprovação automática; shell ativado) is 35 characters. Combined with the prefix (> 3. YOLO ), the total line width is 47 characters, which exceeds the 40-character inner width and will be truncated.
  • The bottom title with "selecionar " (11) and "cancelar " (9) has a total display width of 47 characters, which exceeds the available bottom border width of 42 characters (44 - 2) and will be truncated.

We can optimize these translations to be more concise and natural while fitting perfectly within the 44-column layout:

  • Use "Auto-aprovar; shell ativo" (26 chars) for the YOLO hint.
  • Use "escolher " (9 chars) for select.
  • Use "sair " (5 chars) for cancel.
Suggested change
MessageId::ModePickerTitle => " Modo ",
MessageId::ModePickerInstruction => "Escolha como o CodeWhale deve operar:",
MessageId::ModePickerAgentHint => "Execução normal com aprovações",
MessageId::ModePickerPlanHint => "Planejar antes de executar",
MessageId::ModePickerYoloHint => "Aprovação automática; shell ativado",
MessageId::ModePickerFooterMove => "mover ",
MessageId::ModePickerFooterSelect => "selecionar ",
MessageId::ModePickerFooterCancel => "cancelar ",
MessageId::ModePickerTitle => " Modo ",
MessageId::ModePickerInstruction => "Escolha como o CodeWhale deve operar:",
MessageId::ModePickerAgentHint => "Execução normal com aprovações",
MessageId::ModePickerPlanHint => "Planejar antes de executar",
MessageId::ModePickerYoloHint => "Auto-aprovar; shell ativo",
MessageId::ModePickerFooterMove => "mover ",
MessageId::ModePickerFooterSelect => "escolher ",
MessageId::ModePickerFooterCancel => "sair ",

Comment thread crates/tui/src/localization.rs Outdated
Comment on lines +3990 to +3997
MessageId::ModePickerTitle => " Modo ",
MessageId::ModePickerInstruction => "Elige cómo debe operar CodeWhale:",
MessageId::ModePickerAgentHint => "Ejecución normal con aprobaciones",
MessageId::ModePickerPlanHint => "Planificar antes de ejecutar",
MessageId::ModePickerYoloHint => "Aprobación automática; shell habilitado",
MessageId::ModePickerFooterMove => "mover ",
MessageId::ModePickerFooterSelect => "seleccionar ",
MessageId::ModePickerFooterCancel => "cancelar ",

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 Spanish translation for the YOLO hint (ModePickerYoloHint) and the footer buttons (ModePickerFooterSelect, ModePickerFooterCancel) are too long.

When the terminal is narrow, the mode picker popup is constrained to its minimum width of 44 columns (inner width of 40 columns).

  • The YOLO hint (Aprobación automática; shell habilitado) is 39 characters. Combined with the prefix (> 3. YOLO ), the total line width is 51 characters, which exceeds the 40-character inner width and will be truncated.
  • The bottom title with "seleccionar " (12) and "cancelar " (9) has a total display width of 47 characters, which exceeds the available bottom border width of 42 characters (44 - 2) and will be truncated.

We can optimize these translations to be more concise and natural while fitting perfectly within the 44-column layout:

  • Use "Auto-aprobar; shell activo" (27 chars) for the YOLO hint.
  • Use "elegir " (7 chars) for select.
  • Use "volver " (7 chars) for cancel.
Suggested change
MessageId::ModePickerTitle => " Modo ",
MessageId::ModePickerInstruction => "Elige cómo debe operar CodeWhale:",
MessageId::ModePickerAgentHint => "Ejecución normal con aprobaciones",
MessageId::ModePickerPlanHint => "Planificar antes de ejecutar",
MessageId::ModePickerYoloHint => "Aprobación automática; shell habilitado",
MessageId::ModePickerFooterMove => "mover ",
MessageId::ModePickerFooterSelect => "seleccionar ",
MessageId::ModePickerFooterCancel => "cancelar ",
MessageId::ModePickerTitle => " Modo ",
MessageId::ModePickerInstruction => "Elige cómo debe operar CodeWhale:",
MessageId::ModePickerAgentHint => "Ejecución normal con aprobaciones",
MessageId::ModePickerPlanHint => "Planificar antes de ejecutar",
MessageId::ModePickerYoloHint => "Auto-aprobar; shell activo",
MessageId::ModePickerFooterMove => "mover ",
MessageId::ModePickerFooterSelect => "elegir ",
MessageId::ModePickerFooterCancel => "volver ",

@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-mode-picker branch from 637b787 to 5fa064e Compare June 9, 2026 05: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.

@gordonlu gordonlu force-pushed the feat/i18n-mode-picker branch from 5fa064e to d825ebf Compare June 9, 2026 05:34

@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-mode-picker branch from d825ebf to 0df96b9 Compare June 9, 2026 05:51

@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-mode-picker branch from 0df96b9 to 7147891 Compare June 9, 2026 06:16

@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