Repository navigation
refactor(i18n): name plan usage report words as typed text - #967
Merged
Merged
Conversation
Each usage provider's settings carried their help as English in herdr-usage, which the usage panel's Setup block showed as written. Setting::help becomes Setting::message, the ID of a message in the provider's own locales/en-US/usage-<id>.ftl (156 messages across the providers that read settings). The panel shows it with i18n::message. One file per provider keeps parallel provider PRs out of each other's catalogs. The example config's generated provider section came from the English in herdr-usage. Its generator and bless test move to the app's usage tests, which read the English messages. The section is unchanged byte for byte. A new test checks that every setting names a message without arguments, and the en-XA leak test no longer allows the help as data.
herdr-usage reports carried English Strings for section titles, fact labels and values, share labels, balance labels, window names, and the account line, and count units as English words, which the usage panel showed whatever the language. herdr_usage::Text is now the words a report shows: a message ID with arguments, which the app writes with usage::text::words, or the service's own words. Count units are a typed Count the app writes with a plural (usage-amount-*). Wayfinder names all of its words in usage-wayfinder.ftl; the other providers keep their English through a transitional From<&str>/From<String> for Text and pair/pairs/share/shares helpers, which go once the last of them names its words. A crate below the app cannot use fl!'s compile-time check, so an app test scans herdr-usage for Text::message IDs and the arguments chained to them and checks each against the English messages. The en-XA leak test now draws facts, shares, and a credits balance a provider names.
A fact's value sat at its natural width, so a longer one, as en-XA or another language writes it, ran past the usage card's edge. The value may now shrink and wraps under itself, set against the end side.
Collaborator
Author
|
|
[Medium impact] The PR appears safe to merge, with later message-based CLI window labels covered by PR #968. SummaryAdds typed report text and count units, then moves Wayfinder's report words into Fluent.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
Provider[Provider report] --> Text[Text]
Text --> Service[Service words]
Text --> Message[Message ID and arguments]
Service --> UI[Usage views]
Message --> Fluent[Current-language Fluent text]
Fluent --> UI
Text --> English[English account text]
English --> CLI[CLI output]
Reviews (4) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
This was referenced Nov 1, 2026
Every open i18n pull request edits the remaining list in docs/i18n.md, so each merge made the others conflict. This branch now keeps main's copy; one change updates the list once they have all merged.
# Conflicts: # docs/i18n.md
Collaborator
Author
|
@greptileai review |
Collaborator
Author
|
@greptileai review |
✅ Deploy Preview for herdr-ui canceled.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #955 (base
i18n/usage-settings). Merge #955 first; this PR's base then becomesmain.Summary
Part of Phase 2 of
docs/i18n.md, following #880's patterns. This PR covers the nextherdr-usageitem in "What is left": the words a usage report shows. Every provider passed EnglishStrings for section titles, fact labels and values, share labels, balance labels, the windows it names, and the account line, and named count units ("credits") in English. The panel, the Usage section, and the status bar showed these as written. This PR lays the typed foundation and moves the first provider onto it. The other providers follow in their own PRs.herdr_usage::Text(text.rs): either a message ID with arguments (Text::message("usage-wayfinder-routed").arg("models", 2)) or the service's own words (Text::service(..)). The app writes it withusage::text::words, and command output usesusage::text::english.herdr-usagestays free of GPUI and has no messages of its own.Section::FactsandSection::Shares,Balance::label,Kind::Named, andAccount's two lines are nowText.Unit::Countholds a typedCount(Credits,Points,Reviews, or a unit only one service uses, such asDIEM), and the app writes it with a plural (usage-amount-*).usage-wayfinder.ftl, including the plural model counts, the "keys missing" plan line, and the gateway state's offline and dry-run tags.usage-report.ftlstarts holding words that several providers share.Text::servicethrough a temporaryFrom<&str>/From<String>forTextandpair/pairs/share/shareshelpers. The diff in those files is only these conversions; no output changes. The provider PRs remove them, and the last one deletes theFromimpls, so a leftover literal no longer compiles.fl!checks its IDs at compile time, but a crate below the app can't use it. Instead,usage/tests/report_messages.rsscansherdr-usagefor eachText::messageID and the.argcalls chained to it, and checks them against the English files withi18n::takes.usage/tests/words.rschecks that Wayfinder's messages read in English exactly as the provider wrote them, and that counts take their unit's plural and match the crate's English.No visible change in English.
docs/i18n.mdis left as main has it: one later change updates its "What is left" list once the open i18n PRs merge.Screenshots
Native macOS, debug build, isolated sandbox. A local stub Wayfinder gateway serves the fixture from the provider's tests, so the report is real provider output. The OpenRouter card's error line is fixed by #958, which is not in this stack.
Under en-XB, pseudo-bidi drops the space around an isolated placeable ("2sledom"), as noted in #943. That is the pseudo-locale's per-run reversal, not the message.
QA
just formatjust cion0ed245d25(macOS arm64): passed, with its base andorigin/mainmerged inText::messagein herdr-usage exists with exactly its chained arguments (scan test, with a unit test for the scanner)🤖 Generated with Claude Code
https://claude.ai/code/session_01BFavh7vQNk6CpU1rxrJkHw