Skip to content

refactor(i18n): show the Review tab through Fluent - #952

Merged
penso merged 3 commits into
mainfrom
i18n/review
Nov 1, 2026
Merged

penso merged 3 commits into
mainfrom
i18n/review

Conversation

@penso

@penso penso commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Part of Phase 2 of docs/i18n.md (string migration), following #880, #926, #928, #925, #941, and #943. This PR covers the Review tab. With it, review/ is covered by a // i18n: migrated marker. Two more PRs follow for automations/ and orchestrator/.

  • review/ is marked // i18n: migrated as a whole. Its text comes from a new review.ftl. The checker's count for review goes from 91 to 0. I also reviewed every file by hand for lowercase literals the checker can't see, such as the file status words (new, deleted, renamed, untracked) and the base button's choose a base.
  • Plurals are now Fluent selectors: files changed, folded lines (↕ 3 more lines), a cut-short file, and Find's 2 of 9+ count.
  • Errors: when the changes or the base list can't be read, the view now keeps the error and calls localize() when it draws it. Before, it stored a to_string() taken when the error arrived.
  • Typed state:
    • Why a file's lines are missing used to be English text stored in Body::Failed(String). It is now an Unreadable enum (Change, File, NotFile, TooLarge).
    • An agent that reports no name is now label: None instead of the string "the agent", so the header can say "Notes go to the agent" as one message.
  • Data: these stay English and are marked // i18n: data:
    • the prompt an agent receives with review notes, as for page notes;
    • Git operation names, which the vcs error mapping keys on;
    • the header words Git writes into a diff, now consts in diff/parse.rs;
    • lockfile names.
  • Placeholders: the tab's three fields use set_placeholder_with, so they follow a language change.
  • Leak test: review/view/tests/en_xa.rs draws the changed files, each kind of file the tab can't show (binary, large, unreadable, too large), a note in the notes panel, Find in changes, and a branch review whose base list could not be read.
  • docs/i18n.md is left to main: a final PR updates "What is left" once the i18n PRs merge, so they stop conflicting there.

The Send button and the queued line in the notes panel come from agent_notes, which is another agent's scope, so they still show English.

Screenshots

Native macOS captures from a debug build of this branch, run against an isolated sandbox daemon (sandboxed HOME and XDG directories). The sandbox has a scratch repository with one modified and one untracked file. The tab was opened with herdr-gpui review, and the language was switched with herdr-gpui language set; no synthetic input was used. File names and code are the checkout's own, so they stay as written.

en-XA en-XB
review en-XA review en-XB

Under en-XB, the chrome mirrors, but the diff's code lines are right-aligned and the header keeps its left-to-right order. That is RTL layout of the diff, which this PR does not change; it is left for a Phase 4 follow-up.

QA

  • just format
  • just ci on f6e5581b9 (macOS arm64), after merging main: passed
  • en-XA leak test: files, every unreadable-file placeholder, notes (a sent one and one on a removed line), Find, and the base list
  • left.py completion check: review is at 0
  • Native en-XA and en-XB Review tab against a sandbox daemon (screenshots above)
  • Native: Side by side layout, the base menu on a real branch, and a note sent to a live agent under en-XA
  • English: the Review tab reads as before

Part of Phase 2 of docs/i18n.md. review/ is marked migrated: everything
the Review tab shows comes from review.ftl, with Fluent selectors for its
plurals (files changed, folded lines, a cut-short file, Find's count).

- Errors the tab shows (the changes or the base list that could not be
  read) keep the error and go through localize() when drawn, instead of
  a to_string() taken when they arrived.
- Why a file's lines are missing is an Unreadable enum instead of
  English text stored in Body::Failed.
- An agent that reports no name is None rather than "the agent", so the
  header says "Notes go to the agent" as one message.
- The prompt an agent receives with review notes stays English, marked
  as data, as page notes' prompt is. Git's operation names (which the vcs
  error mapping keys on), Git's diff header words, and lockfile names are
  marked as data too.
- The Review tab gains an en-XA leak test: its files, each kind of file
  it cannot show, a note, Find, and a branch review's base list.
@netlify

netlify Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for herdr-ui canceled.

Name Link
🔨 Latest commit f6e5581
🔍 Latest deploy log https://app.netlify.com/projects/herdr-ui/deploys/6ae795e189cdad7533ab6eeb

@penso

penso commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator Author

just ci ran locally on f6e5581b9 (macOS arm64) and passed.

@greptile-apps

greptile-apps Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

Moves Review tab text into Fluent messages.

  • Review controls and diff messages follow the chosen language.
  • Review notes and their messages follow the chosen language.
  • Git’s fixed strings stay data for the localization checks.

The earlier unnumbered finding is fixed: removed-line and sent-note labels now use Fluent, and the test draws both.

penso explicitly defers the shared Send button and queued text to the agent_notes migration. penso also leaves the existing right-to-left diff layout for Phase 4.

Reviews (3) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

Comment thread crates/herdr-gpui/src/review.rs Resolved
…h Fluent

Greptile noticed the notes list still appended English "(removed)" and "· sent" to a note's place. Both are messages now, and the Review leak test draws a sent note and one on a removed line.
@penso

penso commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

@greptileai review

@penso

penso commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

@greptileai review

@penso
penso merged commit ee0303a into main Nov 1, 2026
20 of 22 checks passed
@penso
penso deleted the i18n/review branch November 1, 2026 21:19
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.

1 participant