Repository navigation
refactor(i18n): show plan usage reports from Kiro to OpenRouter through Fluent - #969
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.
…Fluent
Copilot, Cursor, Deepgram, DeepInfra, DeepSeek, Devin, DevPass, Doubao,
ElevenLabs, Factory, Fireworks, Gemini, GitKraken, Grok, Groq, Helmcode,
Hugging Face, Hyper, IBM Bob, JetBrains, Kilo, and Kimi now name each
word their reports show in their own usage-<provider>.ftl: section
titles, fact labels, values with English words or plurals, balance
labels, the windows they name, and plan lines they compose. Names the
services send (plans, models, tenants, products) stay as the service's
words, and none of them uses Text's transitional conversions.
Where a provider matched its own English labels (Cursor's on-demand
budget, Doubao's window periods), it now carries a selector key the
message picks by. Counts whose English never had a singular ("1
credits") keep it byte for byte, with only an other variant for
translators to extend. usage/tests/words_b.rs checks each provider's
messages read in English as it wrote them.
…gh Fluent
Kiro, LiteLLM, llmman, LLM Proxy, LongCat, Manus, MiMo, MiniMax,
Mistral, Moonshot, Muse, Neuralwatt, Notion, Nous, Ollama, OpenAI,
OpenCode, OpenCode Go, and OpenRouter now name each word their reports
show in their own usage-<provider>.ftl. Plans, models, product names
(Vibe, Notion AI, Ollama Cloud), and the services' own status words stay
as the service's words. OneConsole is shared gateway code and shows
none.
OpenAI's unnamed line items and models are now None rather than English
fallback keys, and show through messages. LiteLLM's spend parser takes a
Reporter enum instead of matching its own label. MiMo, Neuralwatt, and
Muse counts gain a singular ("1 credit" where it said "1 credits").
Named windows sort by their words; message IDs are chosen so each
provider's windows keep their order, which its tests hold, and
Report::new documents it. usage/tests/words_c.rs checks each provider's
English reads as it wrote it.
Collaborator
Author
|
|
[Medium impact] The PR appears safe to merge; no blocking issue was found. SummaryMoves report text for 19 providers, Kiro through OpenRouter, into Fluent messages while keeping service names unchanged.
Reviews (4) · Last reviewed commit: "Merge branch 'i18n/usage-providers-b' in..." · Reviewed by Greptile |
5 of 7 tasks
Collaborator
Author
|
|
5 of 7 tasks
Named windows became message IDs in this branch, and the usage command labeled each window with `Kind::title`, which gives a named window's ID: it printed usage-copilot-premium instead of Premium, and Doubao's window lost its plan and period, which only the message's arguments carry. The command now writes a named window through `usage::text::english`, and a test checks the labels and the JSON the command answers.
Collaborator
Author
|
@greptileai review |
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
# Conflicts: # docs/i18n.md
# 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 #968 (base
i18n/usage-providers-b), and through it on #967 and #955. Merge those first.Summary
Part of Phase 2 of
docs/i18n.md: theherdr-usagereport words, following #967. This PR covers 19 providers, Kiro through OpenRouter: Kiro, LiteLLM, llmman, LLM Proxy, LongCat, Manus, MiMo, MiniMax, Mistral, Moonshot, Muse, Neuralwatt, Notion, Nous, Ollama, OpenAI, OpenCode, OpenCode Go, and OpenRouter. OneConsole is shared gateway code and shows no words.Messages: each provider names its report's words in its own
usage-<provider>.ftl.usage-kiro.ftlis new. Plans, models, product names (Vibe, Notion AI, Ollama Cloud, OpenCode Go), and the services' own status words stay as the service sends them.OpenAI: unnamed line items and models used English fallback keys ("API", "Responses and Chat Completions"). They are now
Noneand shown through messages. A line item the API itself calls "API" no longer merges with unnamed ones.LiteLLM: the spend parser matched its own label string. It now takes a
Reporterenum, and the period value ("start – end UTC") is a message.MiniMax: the daily and hourly window names take a nested
$serviceargument, either a message such as "Video" or the model's name.Plurals: MiMo's credits, Neuralwatt's requests, and Muse's hours are Fluent selectors. These read as before except at 1, where they now say "1 credit" instead of "1 credits".
Window order:
Report::newsorts named windows by their words, which for a message is its ID and arguments. I tried keeping each provider's insertion order instead, but several providers (Antigravity, Cursor, Factory, Gemini, Manus, Windsurf) build windows from maps and relied on the alphabetical sort. So the sort stays. Message IDs are chosen so each provider's windows keep their order, and its tests hold it.Report::newdocuments this.Tests: herdr-usage tests assert message IDs and arguments.
usage/tests/words_c.rschecks that each provider's English reads as it wrote it, for every selector value.docs/i18n.mdis left as main has it: one later change updates its "What is left" list once the open i18n PRs merge.Screenshots
None for this PR: these providers need real sign-ins, which the isolated sandbox doesn't have. #967 shows the same panel and section code with a provider whose report is fully named.
QA
just formatjust cion49cdc1a2d(macOS arm64): passed, with its base andorigin/mainmerged inwords_c.rs: each provider's English reads as before (except the singulars noted above)🤖 Generated with Claude Code
https://claude.ai/code/session_01BFavh7vQNk6CpU1rxrJkHw