Skip to content

Add Russian localization - #248

Merged
Finesssee merged 2 commits into
nesszer:mainfrom
serezha93:agent/add-russian-localization
Aug 4, 2026
Merged

Add Russian localization#248
Finesssee merged 2 commits into
nesszer:mainfrom
serezha93:agent/add-russian-localization

Conversation

@serezha93

@serezha93 serezha93 commented Aug 2, 2026

Copy link
Copy Markdown

Summary

  • add Russian (ru-RU) as a selectable UI language
  • add a complete Fluent catalog covering all 712 application locale keys
  • wire Russian through the Rust settings model, locale loader, and TypeScript bridge
  • add Rust and frontend coverage for language discovery, aliases, bridge payloads, and the settings picker

Why

Win-CodexBar currently offers six UI languages but no Russian option. This adds a native-language experience for Russian-speaking Windows users while preserving the existing English fallback behavior.

Validation

  • cargo test --manifest-path rust/Cargo.toml language --no-fail-fast
  • cargo test --manifest-path rust/Cargo.toml locale::tests --no-fail-fast
  • pnpm run check-locale — 712 keys match between Rust and TypeScript
  • pnpm test — 35 files / 211 tests passed
  • verified placeholder counts match the English catalog for all 712 keys

Build note

pnpm run tauri:build:debug currently stops on two pre-existing TypeScript errors in main: ProviderUsageSnapshot.localUsage in MenuCardDetails.tsx and a null assignment in providerGridUtils.test.ts. Neither file is changed by this PR.

The catalog is complete; further native-speaker wording refinements are welcome during review.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@Finesssee

Copy link
Copy Markdown
Collaborator

Thanks for the PR, I will review it ASAP.

@Finesssee

Copy link
Copy Markdown
Collaborator

Thermo-nuclear code-quality review (automated)

Verdict: Approve on code quality. Clean, pattern-faithful localization addition with good coverage.

The wiring is exactly the established per-language pattern — one Language::Russian variant plus one arm appended to each of the four Language match functions (display_name, all, to_string, aliases), one RU_RU LazyLock + match arm in locale.rs::language_id, one union member in bridge.ts, one FALLBACK_LANGUAGE_OPTIONS entry, and parallel test coverage across all three test files. Nothing leaked into a shared path; no scattered special-casing; no new abstraction. bridge.ts's "russian" stays aligned with Rust to_string(). The new ru-RU.ftl (713 lines / 712 keys) has no duplicate keys, no malformed Fluent lines, and mirrors the English catalog's (unusual but established) { "{}" } literal-brace placeholder convention exactly — e.g. PredictivePaceWarningTitle = { "{}" {} pace warning vs { "{}" } { "{}" } предупреждение о темпе. The fallback-completeness test now includes ru-RU, so the "English is a superset / others fall back" invariant is preserved. The catalog line count is inherent data, not a >1k-logic-file smell.

Nits (non-blocking):

  • settings/types.rs: the four per-language match fns (display_name / all / to_string / aliases) are O(n)-arms per language — a future data-table (lang, code, display, aliases) would collapse all four into one and make adding an 8th language a one-line edit. That's a refactor of pre-existing structure across all 6 existing languages, not this PR's job — flagging only as optional future cleanup, not a blocker.
  • GeneralTab.test.tsx: the test was renamed to renders all supported language options but still asserts toHaveLength(7) — a hardcoded count. If the rename's intent was future-proofing, prefer expect(options.length).toBeGreaterThanOrEqual(7) or assert presence of specific languages. Minor.
  • Native Russian wording review is out of scope for a code-quality pass; the author invited refinement during review.

Process flag for @Finesssee (not #248's fault): the PR body reports pnpm run tauri:build:debug currently fails on two pre-existing TS errors (ProviderUsageSnapshot.localUsage in MenuCardDetails.tsx, a null assignment in providerGridUtils.test.ts) in files this PR doesn't touch. The hosted PR check runs pnpm run build; if those errors are real on main, the build step will fail regardless of this PR. Worth confirming whether main is currently build-broken independently.

@Finesssee

Copy link
Copy Markdown
Collaborator

Thanks for the quick turnaround — both review items are addressed: the language-picker test now uses toBeGreaterThanOrEqual(7), and the two build-breaking TS errors are patched.

Heads-up on overlap: main already carries the same two one-line TS fixes since #250 merged (byte-identical patches — MenuCardDetails localUsage type and the providerGridUtils fixture). A rebase onto current main turns your b106dbb hunks into no-ops and unblocks the hosted build step (main is green again: pnpm run build passes, plus the previously flaky cost-scan tests are now deterministic).

Whenever you're ready: mark the PR ready-for-review + rebase onto main, and the hosted check should go green — happy to merge from there. The localization work itself is approved as-is.

@Finesssee
Finesssee marked this pull request as ready for review August 4, 2026 06:36

@Finesssee Finesssee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved — thermo-nuclear review passed, both nits addressed in b106dbb. Merging.

@Finesssee
Finesssee merged commit 98125eb into nesszer:main Aug 4, 2026
1 check passed
@Finesssee

Copy link
Copy Markdown
Collaborator

Merged 🎉 Thank you @serezha93 — first Russian UI for Win-CodexBar. 712-key catalog, aliases, bridge wiring and tests all in one clean PR, and you handled the review fixes quickly. Ships in the next release; native wording refinements are welcome as follow-up PRs.

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.

2 participants