Skip to content

feat(i18n): add Russian (ru) desktop locale - #66833

Open
timoncool wants to merge 6 commits into
NousResearch:mainfrom
timoncool:feat/i18n-ru-locale
Open

feat(i18n): add Russian (ru) desktop locale#66833
timoncool wants to merge 6 commits into
NousResearch:mainfrom
timoncool:feat/i18n-ru-locale

Conversation

@timoncool

Copy link
Copy Markdown

Russian (ru) locale for Hermes Desktop

Adds a complete Russian locale to the existing TypeScript i18n system (defineLocale()), following the same pattern as the ja / zh / zh-hant locales already on main.

What's included

  • apps/desktop/src/i18n/ru.ts — full defineLocale() catalog, all current UI keys translated (2300+), including the most recent additions: Hermes Cloud gateway, desktop plugins, keybindings, native notifications, UI scale and the layout editor.
  • apps/desktop/src/app/settings/ru-constants.ts — localized settings field labels & descriptions (mirrors constants.ts, wired via fieldLabels / fieldDescriptions).
  • Registration only, nothing else touched: i18n/types.ts (Locale union), i18n/catalog.ts, i18n/languages.ts (LOCALE_OPTIONS + aliases).

Quality

  • npm run typecheck (renderer + electron) — 0 errors.
  • eslint on every touched file — clean.
  • Consistent terminology (шлюз / провайдер / сессия / терминал / навык …); every interpolation function and ${…} placeholder is preserved.
  • Anything not yet translated safely falls back to English via defineLocale.

Notes

This locale is maintained at timoncool/hermes-ru-locale and is already used by Russian-speaking users via a local injector. This PR upstreams it, refreshed against the current main. Happy to adapt it to whatever i18n direction the team settles on.

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) duplicate This issue or pull request already exists labels Jul 18, 2026
@alt-glitch

alt-glitch commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related to #41677 and #40701: this current RU-locale branch includes the additional ru-constants.ts settings surface and substantially broader current catalog coverage. The overlapping open implementations need maintainer consolidation; it is not a duplicate.

@timoncool

Copy link
Copy Markdown
Author

Thanks for the triage. Quick context before this is closed as a duplicate: this is a complete, current RU locale — 2303 / 2303 keys (100%), typecheck + eslint clean — while the canonical #41677 is currently ~825 keys behind main and missing the recent features (Cloud gateway, plugins, keybinds, native notifications, layout editor).

I've reached out on #41677 to consolidate on the most complete path — happy to either bring my coverage there or have this serve as the up-to-date base, deferring to @DrMaks22 / @DrawusMas on the mechanism. Would appreciate keeping this open until that's settled. 🙏

Add behavior-based coverage for the Russian locale without pinning exact
Russian wording:
- normalizeLocale / isLocale / isSupportedLocaleValue / localeConfigValue
  for `ru` and the `ru-RU` and `ru_ru` aliases
- I18nProvider restores a persisted Russian locale from display.language
  and saves the selected Russian locale back to config
- runtime translator resolves the active Russian locale and falls back to
  English when a Russian key cannot be resolved

Test-only change; no production code, ru.ts, or other translations touched.

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for bringing the Russian Desktop locale up to the current i18n structure. Remote main still has no ru Desktop catalog entry (apps/desktop/src/i18n/catalog.ts:7-12), so the feature remains needed.

Problems

  • apps/desktop/src/i18n/ru.ts:73 and several later strings remain English (for example :2025, :2116, and :2393-2404), so the submitted catalog is not yet a complete Russian translation.
  • apps/desktop/src/i18n/ru.ts:968-974 uses count < 5; that selects incorrect Russian forms for 11–14. Those worker strings also start with Latin P, not Cyrillic Р.
  • Locale registration changes have no corresponding behavior coverage. Existing alias tests are in apps/desktop/src/i18n/languages.test.ts:6-42.

Suggested changes

  • Complete the untranslated visible copy and audit the catalog again.
  • Centralize Russian plural selection with the 11–14 exception and apply it to all count strings.
  • Add alias, runtime-registration, and field-copy behavior tests for ru without snapshotting wording.

This is an automated hermes-sweeper review.

Comment thread apps/desktop/src/i18n/ru.ts Outdated
'Фоновый шлюз не запустился. Попробуйте один из вариантов восстановления ниже. Ваши чаты и настройки не удаляются.',
remoteTitle: 'Требуется вход в удалённый шлюз',
remoteDescription:
'Your remote gateway session has expired. Sign in again to reconnect. Nothing here deletes your chats or settings.',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This visible remote-gateway failure message is still English. Please translate it (and audit the other remaining English UI strings) before describing this locale as complete.

Comment thread apps/desktop/src/i18n/ru.ts Outdated
files: 'Файлы',
moreFiles: count => `+${count} файл.`,
delegation: index => `Делегация ${index}`,
workers: count => `${count} P${count === 1 ? 'аботник' : count < 5 ? 'аботника' : 'аботников'}`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Russian pluralization cannot use count < 5: 11–14 require the plural form, and this line also starts the word with Latin P rather than Cyrillic Р. Please use a shared Russian plural helper here and at the sibling count formatters.

@teknium1 teknium1 added the sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users label Jul 18, 2026
@DrMaks22

Copy link
Copy Markdown

Thanks, @timoncool. I completed the focused consolidation patch against your branch rather than opening another upstream duplicate:

timoncool#1

It directly addresses every item in the sweeper review on this PR:

  • all visible RU copy received a native technical editorial pass; protected commands/IDs/product names remain unchanged;
  • plural handling is centralized and covers the 11-14 exception, with the Latin P defects removed;
  • behavior tests cover Russian aliases, persisted selection, runtime registration/fallback, settings field-copy resolution, and plural forms.

Validation on the helper branch: explicit 2303/2303 parity, Desktop typecheck, 5 files / 37 tests, lint with 0 errors, production build, Prettier, and git diff --check all pass.

I also applied the full series to current main (614dc194e) in a clean worktree. It applies without conflicts. Current main has exactly one additional locale key, settings.nav.billing; adding billing: 'Оплата' gives 2304/2304 parity, and typecheck/tests/lint/build remain green.

So the clean path is: merge the helper into this branch, rebase #66833 onto current main, add the one billing entry, and keep this as the complete RU Desktop candidate for maintainer review.

@DrawusMas

DrawusMas commented Jul 19, 2026 via email

Copy link
Copy Markdown

@alt-glitch alt-glitch added needs-decision Awaiting maintainer decision before any implementation and removed duplicate This issue or pull request already exists labels Jul 19, 2026
@teknium1 teknium1 added the area/i18n Localization, locales, translations label Jul 19, 2026
@timoncool

Copy link
Copy Markdown
Author

Thanks @DrMaks22 — merged your helper into the branch via fast-forward. #66833 now carries the full editorial pass, centralized 11–14 plural handling, and the new behavior tests.

@teknium1 this addresses all three points from your sweeper review:

  • untranslated English copy completed (full native technical editorial pass);
  • Russian plural selection centralized with the 11–14 exception; the Latin-P defects are fixed;
  • alias / runtime-registration / field-copy / plural behavior tests added.

Current state: 2303 / 2303 parity, typecheck (renderer + electron) + eslint clean, 36 i18n tests passing, production build green. Next I'll rebase onto current main and add the one new settings.nav.billing key (Оплата) for 2304/2304, keeping this as the single complete RU Desktop candidate. 🙏

@DrMaks22

Copy link
Copy Markdown

Thanks, @timoncool. I completed the current-main continuation we discussed and opened #72250.

This is not an independent translation fork: it preserves your original locale commit, @Anatoly17's behavior-test commit, and the full editorial series already merged into #66833. The series is now cleanly rebased onto main@0054c7edc, synchronized to the current en.ts, and limited to 9 RU/i18n files.

Final validation on #72250:

  • exact current catalog coverage: 2526/2526 leaf entries, enforced by a regression test;
  • Desktop typecheck and production build pass;
  • ESLint: 0 errors;
  • targeted i18n suite: 5 files / 47 tests passed;
  • full UI suite: 278 files / 2371 tests passed / 1 skipped;
  • Electron suite: 65 files / 744 tests passed / 2 skipped;
  • three independent Russian editorial/accuracy passes completed, with all P1 findings resolved.

To keep one review target, #72250 is intended to supersede this now-stale branch while retaining its contribution history. Thank you again for the collaborative consolidation.

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/*) needs-decision Awaiting maintainer decision before any implementation P3 Low — cosmetic, nice to have sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users 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.

6 participants