Skip to content

feat(desktop): add Russian locale - #62215

Closed
milinov885-web wants to merge 5 commits into
NousResearch:mainfrom
milinov885-web:feature/russian-desktop-locale-v2
Closed

milinov885-web wants to merge 5 commits into
NousResearch:mainfrom
milinov885-web:feature/russian-desktop-locale-v2

Conversation

@milinov885-web

@milinov885-web milinov885-web commented Jul 10, 2026

Copy link
Copy Markdown

Summary

Adds Russian (ru) as a supported Hermes Desktop locale.

  • Registers ru, ru-RU, and ru_ru aliases in the typed desktop i18n catalog.
  • Adds the native language selector label Русский and persists the choice as display.language: ru.
  • Sets the document language attribute when the active locale changes.
  • Adds Russian plural handling, including the 11–14 exception.
  • Completes Russian copy for the Appearance screen, including UI scale, inline embeds, and pet settings.
  • Adds focused coverage for normalization, locale persistence, runtime translation, plural rules, the language picker, and <html lang>.

The primary translation work is preserved from the earlier Russian-locale contribution (not reimplemented from scratch); this branch rebases it on current main, adds verification, and fills newly surfaced Appearance copy.

Scope and limitations

This changes only the Electron Desktop i18n layer. It does not alter the Hermes backend, CLI, user installation, or user configuration.

The desktop uses defineLocale() with English fallback by design. New or hard-coded UI copy that has not yet been wired into the i18n catalog therefore remains English rather than producing missing-key errors. This PR keeps that existing fallback behavior intentionally.

Validation

  • npm run test:ui -- src/i18n/languages.test.ts src/i18n/runtime.test.ts src/i18n/context.test.tsx src/components/language-switcher.test.tsx
    • 4 test files, 25 tests passed
  • npm run typecheck
  • npm run build
  • Manual isolated Electron verification with separate HERMES_HOME and user-data directories:
    • selected Russian from Settings → Appearance;
    • verified display.language: ru in the isolated config;
    • restarted the isolated app and verified document.documentElement.lang === "ru";
    • checked the Appearance screen for obvious layout overflow or overlap.

Review request

Please review this as a strict Desktop localization contribution. Approval confirms that the current architecture and translation direction are acceptable; rejection or requested changes are welcome if maintainers prefer consolidation with another active Russian-locale effort.

Anatoly17 and others added 4 commits July 9, 2026 17:41
Full Russian translation for all desktop UI strings. Registers the locale in types.ts, languages.ts, and catalog.ts, and uses defineLocale() so any untranslated string falls back to English.

Adds pluralRu()/countRu() helpers with correct Russian plural rules (incl. the 11-14 exception) and routes all count-based strings through them. Reconciled against current main: dropped removed keys (credentials.or/escToCancel, providers.removeExternal->removeExternalGeneric, agents.tokensK, commandCenter.restartMessaging, sidebar.reorderWorkspace, modelPicker.persistGlobal(Session), clarify.shortcutSuffix/back/send) and moved desktop.branchTitle to its count form.
@alt-glitch alt-glitch added type/feature New feature or request comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have duplicate This issue or pull request already exists labels Jul 10, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Duplicate of #40701 (earliest-open Russian desktop-locale PR). This is one of several competing ru-locale submissions (see also #41677, #50083). Consolidating on the earliest-open canonical; a maintainer can pick the cleanest of the cluster.

@tonydwb tonydwb 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.

Code Review Summary

💡 Found 1 TODO/FIXME comment(s) in added lines.\n---
Reviewed by Hermes Agent

@teknium1

Copy link
Copy Markdown
Collaborator

Thanks for the focused Desktop localization contribution. I found no correctness blocker in the implementation.

Current main still exposes only en, zh, zh-hant, and ja in apps/desktop/src/i18n/catalog.ts:7-12. The PR extends the existing typed locale path rather than creating a parallel mechanism. apps/desktop/src/components/language-switcher.tsx:36-37 derives picker entries from LOCALE_META, and apps/desktop/src/i18n/define-locale.ts:20-40 recursively merges locale overrides over English, so the declared fallback behavior is preserved. The PR also adds alias, persistence, runtime-plural, picker, and document-language coverage.

GitHub currently reports the branch mergeable. The existing duplicate discussion should remain a maintainer consolidation decision.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 11, 2026
@milinov885-web

Copy link
Copy Markdown
Author

Update: Russian desktop locale scope

This update fixes the concrete Russian-localization gaps found during review:

  • adds Russian copy for the file actions menu and Memory Graph;
  • adds initial schema-driven Settings field copy for Display settings;
  • corrects Russian plural forms in worker, token, theme-install, action, file-change, and skill-command counters;
  • adds regression coverage for these surfaces.

Validation completed locally:

  • npm -w hermes run test:ui -- src/i18n/runtime.test.ts src/i18n/languages.test.ts src/i18n/context.test.tsx src/components/language-switcher.test.tsx — 27 tests passed;
  • npm -w hermes run typecheck — passed;
  • npm -w hermes run build — passed.

Honest scope statement

This is not yet a claim of a fully exhaustive Russian translation for every Desktop string. The Desktop locale system intentionally falls back to English for untranslated keys, and several newer or less frequently used surfaces still use that fallback.

The goal of this PR is to provide a solid, tested Russian Desktop baseline without misleading users about completeness. Remaining copy can be translated incrementally in follow-up contributions, with the same typed catalog and regression-test coverage.

@alt-glitch alt-glitch removed the sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades label Jul 12, 2026
@teknium1 teknium1 added the sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades label Jul 12, 2026
@alt-glitch alt-glitch removed the sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades label Jul 12, 2026
@teknium1 teknium1 added the sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades label Jul 12, 2026
@alt-glitch alt-glitch removed the sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades label Jul 12, 2026
@teknium1 teknium1 added the sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades label Jul 12, 2026
@teknium1 teknium1 added the area/i18n Localization, locales, translations label Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/i18n Localization, locales, translations comp/desktop Electron desktop app (apps/desktop/*) duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants