Skip to content

Localize the regen countdown and fix uk-UA terms - #1008

Merged
Finesssee merged 2 commits into
mainfrom
port/uk-countdown-l10n
Oct 24, 2026
Merged

Finesssee merged 2 commits into
mainfrom
port/uk-countdown-l10n

Conversation

@Finesssee

@Finesssee Finesssee commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • The "Regenerates in ..." line on a regenerating quota window was hard-coded English ("in 2d 3h", "now"). It now uses the same localized duration formatter as the other countdowns, so the duration is translated in every locale.
  • A new RegeneratesNow key covers the zero-remaining case, so the whole sentence is localized rather than the bare word "now".
  • Each locale's RegeneratesCountdown template now takes a bare duration and owns its own wording. en-US reads "Regenerates in 2d 3h" as before. uk-UA reads "Регенерує через 2 дн. 3 год". Templates for tr-TR, zh-CN and zh-TW were already natural and are unchanged. ja-JP, ko-KR, pt-BR, es-MX and ru-RU were updated to fit the bare duration.
  • Ukrainian corrections, mapped onto existing keys (no new keys):
    • CredsGeminiCliSetupHelp: "Установіть Gemini CLI ..." to "Встановіть Gemini CLI ..." (spelling of the imperative).
    • CredsJetBrainsHelperMissing: "Установіть IDE JetBrains ..." to "Встановіть IDE JetBrains ...".
    • DurationDays, DurationDaysHours, DurationDaysMinutes: "{} д" to "{} дн." (the standard abbreviation for days, so "2 дн. 3 год").
    • PaceRunsOutIn: "Закінчується за { }" to "Закінчується через { }".
    • PaceProjectedEmptyIn: "Передбачається порожній у { }" to "За прогнозом, вичерпається через { }".
    • PaceProjectedEmptyNow: "Зараз проектується порожнім" to "За прогнозом, ліміт вичерпано".
    • TokenActivityDaily, WindowLabelDaily: "Щодня" to "Денний".
    • TokenActivityWeekly: "Щотижня" to "Тижневий".
    • ProviderLabelMonthly: "Щомісяця" to "Місячний".
    • UsageSpendTokenInput: "Вхід" to "Вхідні".
    • UsageSpendTokenOutput: "Вихід" to "Вихідні".
  • Not applied: term-preference rewrites from the upstream uk catalog (for example "провайдер" to "постачальник" and "жетони" to "токени"), and wording that differs from upstream without a clear error. These are style choices, so they are left for the maintainers.
  • A new browser proof scenario, tray-uk-regen-countdown, shows a regenerating Claude session window under the shipped uk-UA strings. It uses the uk-UA catalog through a new ukLocaleOverrides helper in src/proof/locale.ts; the rest of the surface stays English because the proof bundle is English-only.

Upstream reference: commit 8cb4d93 (steipete#4676). Relevant files: Sources/CodexBarCore/UsageFormatter.swift (hunks at old lines 107 and 155) and the uk.lproj catalogs. The Windows port keeps its own formatter; the upstream resetCountdownDuration split is not ported, and the Widget catalog is out of scope for Windows.

Files changed:

  • apps/desktop-tauri/src/lib/metricRowModel.ts: regenCountdown removed; regenText uses formatCountdown and RegeneratesNow.
  • apps/desktop-tauri/src/lib/metricRowModel.test.ts: en-US and uk-UA regen cases, and a ja-JP case.
  • apps/desktop-tauri/src/i18n/keyGroups/providerText.ts: adds RegeneratesNow.
  • apps/desktop-tauri/src/proof/fixtures/scenarios.ts: new uk-regen-countdown fixture.
  • apps/desktop-tauri/src/proof/locale.ts: new ukLocaleOverrides helper.
  • apps/desktop-tauri/scripts/proof-scenarios.json: new tray-uk-regen-countdown scenario.
  • rust/src/locale.rs: adds the RegeneratesNow key.
  • rust/src/locale/*.ftl (10 files): the RegeneratesCountdown template, the new RegeneratesNow key, and (uk-UA only) the term corrections above.

Checks

  • pnpm exec vitest run src/proof src/lib/metricRowModel.test.ts: 123 passed, 0 failed (5 files).
  • pnpm test (full frontend): 164 files, 1622 tests passed, 0 failed.
  • pnpm exec tsc --noEmit: clean.
  • pnpm run build: passes (includes the check-locale prebuild step).
  • pnpm proof:check: 46 of 46 scenarios passed, including the new tray-uk-regen-countdown. Screenshots are in .proof-out/all/ in the worktree (Chromium, mocked IPC). The new screenshot is .proof-out/uk/tray-uk-regen-countdown.png, which shows "Регенерує через 2 дн. 3 год" beside "Session (5h) 22% used".
  • cargo fmt --all: clean.
  • cargo test --manifest-path rust/Cargo.toml --lib locale: 26 passed, 0 failed.
  • cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings: passes.
  • cargo clippy --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml --all-targets -- -D warnings: passes.
  • cargo test --manifest-path rust/Cargo.toml --lib (full): 5279 passed, 0 failed, 2 ignored. This run was made after building the fake_grok_acp example, which the grok ACP tests need.
  • cargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml (full): 804 passed, 0 failed.

Not covered:

  • No desktop app launch or CUA proof. The change touches only webview text, so the browser proof is the designated evidence. The proof is labelled "Chromium, mocked IPC".
  • The uk-UA proof is partial by design: only the countdown keys are Ukrainian, because the proof bundle has no full uk locale.
  • Widget and Mac-only catalogs are not touched.

Summary by CodeRabbit

  • Bug Fixes

    • Regeneration countdowns now display duration values with the appropriate wording and prepositions for each supported language.
    • When a reset is happening immediately, the app now shows a localized “regenerates now” message instead of a countdown.
  • Localization

    • Updated Ukrainian wording across usage and activity labels, and improved regeneration messages in several languages.
    • Added coverage for a Ukrainian countdown longer than two days.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 2ce961b and d942dda.

📒 Files selected for processing: 17
  • apps/desktop-tauri/scripts/proof-scenarios.json
  • apps/desktop-tauri/src/i18n/keyGroups/providerText.ts
  • apps/desktop-tauri/src/lib/metricRowModel.test.ts
  • apps/desktop-tauri/src/lib/metricRowModel.ts
  • apps/desktop-tauri/src/proof/fixtures/scenarios.ts
  • apps/desktop-tauri/src/proof/locale.ts
  • rust/src/locale.rs
  • rust/src/locale/en-US.ftl
  • rust/src/locale/es-MX.ftl
  • rust/src/locale/ja-JP.ftl
  • rust/src/locale/ko-KR.ftl
  • rust/src/locale/pt-BR.ftl
  • rust/src/locale/ru-RU.ftl
  • rust/src/locale/tr-TR.ftl
  • rust/src/locale/uk-UA.ftl
  • rust/src/locale/zh-CN.ftl
  • rust/src/locale/zh-TW.ftl

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

📝 Walkthrough

Regeneration countdowns now use localized duration text, with separate messages for timed and immediate regeneration. Locale strings and tests cover multiple languages and durations. A Ukrainian proof scenario checks the displayed countdown in the tray panel.

Changes: Regeneration locale messages

Layer / File(s) Summary
Countdown and immediate-regeneration messages
rust/src/locale.rs, rust/src/locale/*.ftl, apps/desktop-tauri/src/i18n/keyGroups/providerText.ts
Added the RegeneratesNow key and translations. Updated countdown wording in several locales. Ukrainian locale text also changes in pace, activity, usage-window, duration, and token labels, plus two setup instructions.

Countdown formatting and tests

Layer / File(s) Summary
Localized countdown formatting and coverage
apps/desktop-tauri/src/lib/metricRowModel.ts, apps/desktop-tauri/src/lib/metricRowModel.test.ts
Countdowns now format durations with localized keys and use RegeneratesNow when no duration remains. Tests cover Ukrainian and Japanese countdowns, including 45 minutes, 2 days and 3 hours, and an expired countdown.

Ukrainian proof scenario

Layer / File(s) Summary
Tray proof fixture and screenshot check
apps/desktop-tauri/src/proof/locale.ts, apps/desktop-tauri/src/proof/fixtures/scenarios.ts, apps/desktop-tauri/scripts/proof-scenarios.json
Added a Ukrainian locale override helper and a proof scenario with Claude regenerating in 2 days, 3 hours, and 30 minutes. The tray check expects Ukrainian countdown text and excludes the English alternatives.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: pasharm

Merge Risk: ⚪ Minimal · up to d942d

The localized countdown and Ukrainian proof scenario have no identified issue blocking merge; normal checks remain appropriate.

Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

Failed Failed checks: 1 error · 1 inconclusive

Check name Status Explanation Resolution
Provider Data Stays Siloed Error The PR adds provider-specific branching in shared code. In apps/desktop-tauri/src/proof/fixtures/scenarios.ts:1121, ukRegenCountdownScenario matches snap.providerId !== "claude" while mapping al… Remove the providerId match from shared scenario logic. Move the Claude-specific fixture mutation into a provider-scoped helper/module, or use a provider-neutral fixture construction path that does not branch on a specific ProviderId in s…
Ui Changes Include Windows Proof Inconclusive The PR changes visible UI behavior: metricRowModel.ts now produces localized regeneration text, and CardMetricRow.tsx renders that value. The available description reports only a Chromium proof wi… Provide the complete PR description, or confirm that it contains a screenshot or proof note from a fresh Windows build. The available evidence is insufficient to make the required description check definitive.
Passed Passed checks: 6 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title is a short imperative summary that accurately covers the localized regeneration countdown and Ukrainian terminology updates.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Secrets Handled Safely Passed PASS. The PR changes only countdown formatting, locale strings, tests, and synthetic proof data. Added code contains no logging or error sinks, credentials, tokens, cookies, API keys, OAuth values, or…
No Unapproved Dependencies Passed The reviewed diff changes only application, locale, test, and proof files. It does not modify any Cargo.toml or package.json, add an npm/yarn lockfile, or change the pinned pnpm packageManager version…
Full details: Secrets Handled Safely

Explanation

PASS. The PR changes only countdown formatting, locale strings, tests, and synthetic proof data. Added code contains no logging or error sinks, credentials, tokens, cookies, API keys, OAuth values, or authorization headers. The Ukrainian gemini auth login text is an instructional command, not a credential. No credential or keyring files are changed or deleted.

Full details: No Unapproved Dependencies

Explanation

The reviewed diff changes only application, locale, test, and proof files. It does not modify any Cargo.toml or package.json, add an npm/yarn lockfile, or change the pinned pnpm packageManager version. No dependency approval is required.

Full details: Provider Data Stays Siloed

Explanation

The PR adds provider-specific branching in shared code. In apps/desktop-tauri/src/proof/fixtures/scenarios.ts:1121, ukRegenCountdownScenario matches snap.providerId !== "claude" while mapping all provider snapshots. This is outside rust/src/providers/<name>/ and rust/src/core/provider_factory.rs. The changed locale and countdown code does not show an identity or account leak, but the added ProviderId branch independently matches the failure condition.

Resolution

Remove the providerId match from shared scenario logic. Move the Claude-specific fixture mutation into a provider-scoped helper/module, or use a provider-neutral fixture construction path that does not branch on a specific ProviderId in shared code.

Full details: Ui Changes Include Windows Proof

Explanation

The PR changes visible UI behavior: metricRowModel.ts now produces localized regeneration text, and CardMetricRow.tsx renders that value. The available description reports only a Chromium proof with mocked IPC and a screenshot, not a fresh Windows build. However, the supplied description is explicitly marked truncated, so omitted text could contain the required Windows proof note or screenshot.

Resolution

Provide the complete PR description, or confirm that it contains a screenshot or proof note from a fresh Windows build. The available evidence is insufficient to make the required description check definitive.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-merge checks failed. Please resolve the failing checks before merging.

@Finesssee

Copy link
Copy Markdown
Collaborator Author

@coderabbitai Thanks for the pre-merge checks. Answers to both:

Provider Data Stays Siloed. scenarios.ts is a browser-proof fixture under src/proof/, not shared product code. It is kept out of the production bundle (src/proof/isolation.test.ts). The providerId check on line 1121 only picks which synthetic snapshot gets the regenerating reset. It doesn't move identity, plan or email between providers. The other snapshots pass through unchanged. The same fixture pattern is already on main at lines 699 and 1043 of this file. The siloing rule covers runtime paths in rust/src and the shell, and this PR doesn't touch those.

UI Changes Include Windows Proof. This change is limited to webview content: localized copy in metricRowModel.ts, rendered by CardMetricRow.tsx, plus uk-UA .ftl strings. Under the repo's browser-proof rule, pnpm proof:check is enough for webview copy and i18n changes. The tray-uk-regen-countdown scenario passes on the head commit (Chromium, mocked IPC), as the PR description says. The change doesn't touch the tray icon, the tray menu, window chrome, theme or float bar.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
fd -H -t f '^(AGENTS\.md|scenarios\.ts|isolation\.test\.ts|metricRowModel\.ts|CardMetricRow\.tsx|WINDOWS_PROOF\.md|uk-UA\.ftl|proof-scenarios\.json)$' --exclude .git
printf '\n--- Repository instructions ---\n'
cat AGENTS.md
printf '\n--- Nested instructions ---\n'
fd -H -t f '^AGENTS\.md$' apps rust docs --exclude .git
printf '\n--- Proof policy ---\n'
rg -n -C 7 'browser|webview|copy|i18n|CUA|cua|Windows|proof:check|must|require' docs/WINDOWS_PROOF.md
printf '\n--- Candidate outlines ---\n'
ast-grep outline apps/desktop-tauri/src/proof/fixtures/scenarios.ts apps/desktop-tauri/src/proof/isolation.test.ts apps/desktop-tauri/src/lib/metricRowModel.ts --items all
printf '\n--- Fixture implementation ---\n'
sed -n '1070,1165p' apps/desktop-tauri/src/proof/fixtures/scenarios.ts
printf '\n--- Isolation tests ---\n'
cat apps/desktop-tauri/src/proof/isolation.test.ts
printf '\n--- Countdown implementation ---\n'
rg -n -C 10 'RegeneratesNow|RegeneratesCountdown|localized.*Duration|function metricResetText' apps/desktop-tauri/src/lib/metricRowModel.ts
printf '\n--- Rendering file ---\n'
fd -t f '^CardMetricRow\.tsx$' apps --exec ast-grep outline {} --items all
fd -t f '^CardMetricRow\.tsx$' apps --exec rg -n -C 6 'metricResetText|resetText|metricRowModel' {}
printf '\n--- Ukrainian locale and proof scenario ---\n'
rg -n -C 3 'Regenerates|Duration' rust/src/locale/uk-UA.ftl
rg -n -C 8 'tray-uk-regen-countdown' apps/desktop-tauri/scripts/proof-scenarios.json

Length of output: 58848


@Finesssee I couldn't produce a complete response to this request. Please try again.


📝 I couldn't check this conversation for new learnings, so no new learning was saved.


🧠 Learnings used
Learnt from: CR
Repo: nesszer/Win-CodexBar PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-10-20T02:42:45.969Z
Learning: Source excerpt:
# Repository Guidelines

## Code conventions

- Keep provider data siloed: never show identity, plan or email from provider A in provider B's UI.
Learnt from: CR
Repo: nesszer/Win-CodexBar PR: 0
File: docs/WINDOWS_PROOF.md:0-0
Timestamp: 2026-10-21T08:08:55.014Z
Learning: Applicability reference:
AGENTS.md: # Repository Guidelines
## Architecture and data flow
[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) has the full picture. The rules that matter on every change:

- **Proof harness.** `CODEXBAR_PROOF_MODE` (for example `settings:menu`) opens one surface and turns off blur-dismiss for automation. `CODEXBAR_SEED_USAGE_JSON=<abs-path>` seeds synthetic bridge-shaped `ProviderUsageSnapshot` data into the provider cache at launch, pinned against refresh eviction. A malformed seed file logs a warning and is skipped. See [docs/WINDOWS_PROOF.md](docs/WINDOWS_PROOF.md#proof-mode).

AGENTS.md: # Repository Guidelines
## Testing & QA
### UI validation with CUA ([trycua/cua](https://github.com/trycua/cua))
[docs/WINDOWS_PROOF.md](docs/WINDOWS_PROOF.md) has the cua-driver install command (driver usually at `%LOCALAPPDATA%\Programs\Cua\cua-driver\bin\cua-driver.exe`), the CDP target URLs, the cua-driver session rules and the post-install checklist.

AGENTS.md: # Repository Guidelines
## Testing & QA
### Browser proof (`pnpm proof:check`)
The React surfaces also run in a plain browser over mocked IPC (`apps/desktop-tauri/proof.html`, fixtures in `src/proof/`). `pnpm proof:check`, run from `apps/desktop-tauri`, drives Chrome, Edge or Chromium over CDP through `scripts/proof-scenarios.json`. It prints PASS or FAIL for each scenario and saves screenshots. It runs on any OS, so subagents and CI can use it without a Windows desktop. Details: `docs/WINDOWS_PROOF.md` section 5.

AGENTS.md: # Repository Guidelines
## Docs index
| Need | File |
| --- | --- |
| Proof mode, seeding, CDP, cua-driver | `docs/WINDOWS_PROOF.md` |

Source excerpt:
# Proving UI changes on Windows

## Proof mode

### Seed usage data

A file the app can't read or parse logs a warning, and the app starts without the seed. A normal refresh doesn't replace seeded data while the cache holds every provider the refresh asks for. A forced refresh, such as **Refresh All**, fetches live data.
Learnt from: CR
Repo: nesszer/Win-CodexBar PR: 0
File: docs/WINDOWS_PROOF.md:0-0
Timestamp: 2026-10-21T08:08:55.014Z
Learning: Applicability reference:
AGENTS.md: # Repository Guidelines
## Architecture and data flow
[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) has the full picture. The rules that matter on every change:

- **Proof harness.** `CODEXBAR_PROOF_MODE` (for example `settings:menu`) opens one surface and turns off blur-dismiss for automation. `CODEXBAR_SEED_USAGE_JSON=<abs-path>` seeds synthetic bridge-shaped `ProviderUsageSnapshot` data into the provider cache at launch, pinned against refresh eviction. A malformed seed file logs a warning and is skipped. See [docs/WINDOWS_PROOF.md](docs/WINDOWS_PROOF.md#proof-mode).

AGENTS.md: # Repository Guidelines
## Testing & QA
### UI validation with CUA ([trycua/cua](https://github.com/trycua/cua))
[docs/WINDOWS_PROOF.md](docs/WINDOWS_PROOF.md) has the cua-driver install command (driver usually at `%LOCALAPPDATA%\Programs\Cua\cua-driver\bin\cua-driver.exe`), the CDP target URLs, the cua-driver session rules and the post-install checklist.

AGENTS.md: # Repository Guidelines
## Testing & QA
### Browser proof (`pnpm proof:check`)
The React surfaces also run in a plain browser over mocked IPC (`apps/desktop-tauri/proof.html`, fixtures in `src/proof/`). `pnpm proof:check`, run from `apps/desktop-tauri`, drives Chrome, Edge or Chromium over CDP through `scripts/proof-scenarios.json`. It prints PASS or FAIL for each scenario and saves screenshots. It runs on any OS, so subagents and CI can use it without a Windows desktop. Details: `docs/WINDOWS_PROOF.md` section 5.

AGENTS.md: # Repository Guidelines
## Docs index
| Need | File |
| --- | --- |
| Proof mode, seeding, CDP, cua-driver | `docs/WINDOWS_PROOF.md` |

Source excerpt:
# Proving UI changes on Windows

## 5. Mocked-IPC proof build

### Automated check: `pnpm proof:check`

Add or extend a scenario for the UI a PR changes.

You are interacting with an AI system.

@Finesssee
Finesssee merged commit 7d9326b into main Oct 24, 2026
3 checks passed
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