Skip to content

refactor(i18n): show the window's notices and tab faces through Fluent - #941

Merged
penso merged 5 commits into
mainfrom
i18n/window-notices
Oct 31, 2026
Merged

penso merged 5 commits into
mainfrom
i18n/window-notices

Conversation

@penso

@penso penso commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Part of Phase 2 of docs/i18n.md, following #880's patterns. This PR covers the first sub-area of the main window's notices: toasts, flashes, notifications, and the tab faces' muted hint. Input, paste, transfer, find, copy mode, and annotation text in window/ follow in their own PRs.

  • Messages: window-notices.ftl (flashes, the status line's request failures, the config diagnostic cards, the agent skill offer, zen mode, the Shift-select hint, checkpoint restores) and notifications.ftl (the untitled notice and the QA toast and system notification previews). tab-layout.ftl gains the muted hint and the close button's name.
  • Marked // i18n: migrated: notifications.rs, tab_layout.rs, and in window/: toasts, flash, system_notifications, config_diagnostic, commands, monitors, zen, and select_hint. D-Bus names and Windows registry keys in the system notification backends are tagged // i18n: data.
  • Errors: notices that turned an error into a String with to_string() now use localize(): request failures, the agent skill install, keep-awake, checkpoint restores, and dismissing the announcement. A failed restore's flash still names its cause (previously checkpoint::describe's English chain): a failed Git script's or worker's error follows the message, so Git's output or the SSH failure stays in view.
  • Previews: the QA toast and system notification previews set their title and body from the messages after Notice::new, whose safe_text cleanup of daemon text would strip the direction marks en-XB (and a right-to-left language) needs.
  • Plurals: the skill install's "N places" is a Fluent selector.
  • Tests: window/toasts/tests/mirrored.rs checks a preview keeps its en-XB marks, and window/monitors/tests.rs checks a failed restore keeps its cause. notifications.rs's inline test module moves to notifications/tests.rs, as AGENTS.md asks. A new window/tests/en_xa_notices.rs leak test covers each toast preview kind, a hint, a flash, the status line's error, the config diagnostic card, and the agent skill offer.
  • Docs: the "What is left" list in docs/i18n.md is updated.

Still English

  • The text the GUI config diagnostic (Config::diagnostic) and the icon font notice put inside those cards. Only the cards' own label is a message. Both modules are outside window/. Noted in "What is left".
  • The rest of window/: input, paste, transfer, images, find, copy mode, selection, and annotation (next PRs).

No visible change in English.

Screenshots

Native macOS captures, debug build, against an isolated sandbox daemon. The config card's body is the config module's own text, which is still English (see above).

en-XA (accented, longer) en-XB (right to left)
Config diagnostic card notices en-XA notices en-XB
Zen mode flash zen en-XA zen en-XB

QA

  • just format
  • just ci on ae2cb7063 (macOS arm64, after merging main): passed, 16,288 tests, 0 failed; check-i18n: 3642 messages in 156 files valid and used
  • just lint-linux, just lint-windows on a77e4834a: passed (the later commits touch no cfg gate)
  • Regression tests: an en-XB toast preview keeps its direction marks; a failed restore's flash keeps its Git script's or worker's cause
  • en-XA leak test: four toast previews, the Shift-select hint, a flash, the status line's error, the config diagnostic card, and the agent skill offer
  • Native en-XA and en-XB check of the config diagnostic card and the zen mode flash (screenshots above)
  • QA > Notifications under en-XA: each toast preview and the system notification preview show bracketed, accented text
  • A fresh profile under en-XA: the agent skill offer reads in en-XA, and Install flashes "Installed the browser skill at …"
  • A tab face that hides its title (Compact layout) on a muted tab: its tooltip reads "… (notifications muted)" in en-XA
  • English: the notices read as before

🤖 Generated with Claude Code

https://claude.ai/code/session_01BFavh5CsF9aiVsJURUwioh

penso and others added 3 commits October 31, 2026 10:39
#905 (iOS app, one pairing for every machine) and #926 (localized
errors) merged independently. #905 moved herdr-automate's binary,
checksum, and platform failures into host_build::Error and added
herdr_client::Error::TerminalAttach, remote control's app::Error::Enroll,
and the root Error::Nearby, none of which had a Localize mapping, so main
no longer compiled.

Each new enum gets its own mapping and .ftl file, as #926 set out:
host_build (error-host-build.ftl, which takes over the three automation
messages), terminal_attach (error-client-terminal-attach.ftl), nearby
(error-nearby.ftl), and enroll (in error-remote-control.ftl). Per-variant
tests cover each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BFavh5CsF9aiVsJURUwioh
Part of Phase 2 of docs/i18n.md, following #880. Toasts, flashes, the
config diagnostic cards, the agent skill offer, and the window's command
notices take their text from window-notices.ftl and notifications.ftl;
the tab faces' muted hint and close button from tab-layout.ftl.

- Marked migrated: notifications.rs, tab_layout.rs, and in window/ the
  toasts, flash, system notifications, config diagnostic, commands,
  monitors, zen, and Shift-select hint modules. D-Bus and registry names
  in the system notification backends are tagged as data.
- Errors reaching these notices use localize() instead of to_string():
  request failures, the agent skill install, keep-awake, checkpoint
  restores, and dismissing the announcement.
- The skill install's place count is a Fluent selector.
- notifications.rs's inline test module moves to notifications/tests.rs.
- A new en-XA leak test covers each toast preview, a hint and a flash,
  the status line's error, the config diagnostic card, and the agent
  skill offer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BFavh5CsF9aiVsJURUwioh
@penso

penso commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator Author

just ci ran locally and passed on ae2cb70 (macOS arm64): 16,288 tests, 0 failed. Also ran just lint-linux and just lint-windows on a77e483 (both passed); the later commits touch no cfg gate.

@greptile-apps

greptile-apps Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] No new blocking issue was found in the reviewed changes.

Summary

Moves window notices and tab labels into Fluent.

  • Window prompts and status messages now use translated text.
  • Checkpoint flashes use translated messages and keep failure details.
  • QA notification previews now use translated text and keep direction marks.
  • Muted tab hints and close-button names now use translated text.
  • Platform notification names are marked as fixed data.

No new findings were accepted. The supplied previous threads have no comment numbers, so they receive no numbered classifications.

Reviews (2) · Last reviewed commit: "fix(i18n): keep preview direction marks ..." · Reviewed by Greptile

Comment thread crates/herdr-gpui/src/window/toasts.rs Resolved
# Conflicts:
#	crates/herdr-gpui/locales/en-US/error-client-terminal-attach.ftl
#	crates/herdr-gpui/locales/en-US/error-host-build.ftl
#	crates/herdr-gpui/locales/en-US/error-nearby.ftl
#	crates/herdr-gpui/locales/en-US/error-remote-control.ftl
#	crates/herdr-gpui/src/i18n/errors/client/terminal_attach.rs
#	crates/herdr-gpui/src/i18n/errors/host_build.rs
#	crates/herdr-gpui/src/i18n/errors/nearby.rs
#	crates/herdr-gpui/src/i18n/errors/remote_control.rs
#	crates/herdr-gpui/src/i18n/errors/tests/nearby.rs
Greptile on #941: Notice::new cleans daemon text with safe_text, which
also stripped the direction marks en-XB puts in the QA toast and system
notification previews; previews now set their title and body from the
messages afterwards. A failed checkpoint restore's flash lost the cause
checkpoint::describe used to append; a failed Git script's or worker's
error now follows the message. Also puts host_build.rs's keep-sorted end
marker back on its own line, which main's rustfmt had folded away.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BFavh5CsF9aiVsJURUwioh
@penso
penso changed the base branch from fix/i18n-errors-after-905 to main October 31, 2026 19:36
@penso

penso commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator Author

@greptileai review

@penso
penso merged commit 231f2a2 into main Oct 31, 2026
@penso
penso deleted the i18n/window-notices branch October 31, 2026 19:41
shin1ohno added a commit to shin1ohno/herdr-gpui that referenced this pull request Nov 1, 2026
Brings in upstream's 16 commits, among them the native Herdr Remote app
and one pairing for every machine (sheprd-labs#905), the device picker rebuilt as
unfolding devices (sheprd-labs#939), and the i18n Fluent migrations with exhaustive
error mappings (sheprd-labs#913, sheprd-labs#915, sheprd-labs#924, sheprd-labs#925, sheprd-labs#926, sheprd-labs#941).

Conflicts: upstream's picker, sessions and usage code win; the iPad's
needs are re-applied on top. The iPad's Sessions entry now lives on the
unfolded SSH Herdr 1 device (the old footer button and Page::Sessions
are gone upstream). Every error variant this branch added has a Fluent
message, and the iPad's cloud, update and remote notices say iPadOS
instead of Windows. The local scan never runs on iPad.

On the desktop, the picker and sidebar read the selected device's
connection state from the window, as this branch did before. View-level
iPad picker and Sessions behaviour is type-checked; its pure predicates
run in the host tests.
penso added a commit that referenced this pull request Nov 1, 2026
… Fluent (#954)

* refactor(i18n): show the config diagnostic and icon font text through Fluent

Part of Phase 2 of docs/i18n.md. The GUI config diagnostic
(Config::diagnostic) and the icon font notice now build their lines from
config-diagnostic.ftl, so the cards #941 labeled read in the window's
language. Unknown-key and missing-font lists are whole sentences with a
selector for the "and N more" remainder.

The cards used to clean every line with safe_text, which drops the
isolation and direction marks a right-to-left language needs. Daemon text
still goes through that; the app's own text uses ConfigDiagnostic::sync_own,
which only bounds it, and the names from the user's file are cleaned
before they join a message.

config/ is marked migrated: font and theme names, registry keys, the
seeded overrides file, and serde's own parser text are data. The inline
tests of config/preferences.rs and config/sidebar.rs move to their own
files.

* test: compare the config diagnostic's English without isolation marks

Config::diagnostic now builds its lines from messages, so the remaining
test that compared it verbatim strips the marks Fluent adds, and the GUI
diagnostic card tests feed it through sync_own as the window does.

* fix(i18n): rewrite the config and icon font cards after a language switch

QA > Pseudo-Locale only redraws the windows, so the GUI config card kept
the language it was built in until the next config reload. The window's
tick now asks the card to write its text again when the shown locale
differs from the one it was written in, keeping a dismissal or an opened
card, since it is the same warning in another language.

The icon font notice formatted its two messages on every tick once a
missing font was detected, even after a dismissal. It now writes them
once, and again only after a language switch.

* test: dismiss the accented icon font card without unwrap
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