Skip to content

feat(i18n): add Russian locale#409

Open
kostyaff wants to merge 3 commits into
fathah:mainfrom
kostyaff:feat/russian-locale
Open

feat(i18n): add Russian locale#409
kostyaff wants to merge 3 commits into
fathah:mainfrom
kostyaff:feat/russian-locale

Conversation

@kostyaff

@kostyaff kostyaff commented May 27, 2026

Copy link
Copy Markdown

Summary

Adds a complete Russian (ru) locale for Hermes Desktop, synced with the current English locale modules.

What changed

  • Added Russian translations for all source English locale modules, including the newer discover and diagnose namespaces.
  • Registered ru in the supported locale list and AppLocale type.
  • Added Русский to the Settings language picker.
  • Added i18n test coverage for Russian locale resolution, interpolation, and en/ru key parity.
  • Included the kanban module for Russian so the locale stays structurally aligned with English.

Translation notes

  • Technical terms such as API Key, OAuth, MCP, SSH, URL, provider names, product names, worker, and kanban are kept recognizable where that matches the existing UI style.
  • Russian copy uses sentence case for UI labels and buttons.
  • Russian text consistently uses е rather than ё.
  • Count labels that would need Russian plural rules are phrased to avoid incorrect forms like 1 навыков, without changing the shared i18n architecture in this PR.

Validation

  • npm run test -- src/shared/i18n/index.test.ts tests/locale-persistence.test.ts - passes: 2 files, 14 tests
  • npm run typecheck - passes
  • npx eslint src/shared/i18n/index.ts src/shared/i18n/index.test.ts src/shared/i18n/config.ts src/shared/i18n/types.ts src/shared/i18n/locales/ru/*.ts src/renderer/src/screens/Settings/Settings.tsx - passes
  • Placeholder and HTML tag parity checked between en and ru
  • en/ru key parity is covered by the added test

Note: one local run of locale-persistence.test.ts hit Vitest's 5s timeout, then the same targeted command passed on immediate rerun. No i18n key or type failures reproduced.

@kostyaff kostyaff force-pushed the feat/russian-locale branch 2 times, most recently from d5d233f to 8ca7eb6 Compare May 27, 2026 05:26
@kostyaff kostyaff marked this pull request as ready for review May 27, 2026 05:32
@greptile-apps

greptile-apps Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds a complete Russian (ru) locale across all 23 translation namespaces, registers ru in the AppLocale type, APP_LOCALES array, and the Settings language picker, and includes a key-parity test that enforces structural alignment with English going forward.

  • All locale modules import and register correctly in resources.ru.translation; placeholder and HTML-tag parity with English was verified by the author and is now enforced by the new parity test.
  • diagnose.ts is the only ru file missing as const (mirroring the English source), making it inconsistent with the other 22 Russian modules.
  • Plural forms for Russian (few/many) are intentionally deferred per the PR description; affected strings are phrased to avoid the most jarring mismatches.

Confidence Score: 5/5

Safe to merge — all changes are additive locale files with no logic or runtime-path modifications.

The PR adds translation strings and registration boilerplate only; nothing existing is modified except inserting 'ru' into a union type, an array, and a display-name map. The new key-parity test catches structural drift, typecheck passes, and no runtime logic is touched.

No files require special attention beyond the minor as const omission in diagnose.ts.

Important Files Changed

Filename Overview
src/shared/i18n/locales/ru/diagnose.ts New Russian translation for the diagnose namespace; mirrors English content correctly but missing as const unlike every other ru locale file.
src/shared/i18n/index.ts All 23 Russian locale modules imported and registered under resources.ru.translation with the correct namespace order matching other locales.
src/shared/i18n/index.test.ts Adds locale resolution, key-parity, and interpolation tests for ru; the collectKeys helper correctly flattens nested objects for structural comparison.
src/shared/i18n/types.ts Adds "ru" to the AppLocale union type in alphabetical position.
src/shared/i18n/config.ts Appends "ru" to APP_LOCALES in alphabetical position.
src/renderer/src/screens/Settings/Settings.tsx Adds ru: "Русский" to LANGUAGE_NATIVE_NAMES in alphabetical position; straightforward registration.
src/shared/i18n/locales/ru/agents.ts Translation looks accurate; plural workaround for skillsCount (genitive plural for all counts) is acknowledged in the PR as a known limitation.
src/shared/i18n/locales/ru/office.ts Uses agentCount_one/agentCount_other matching the English structure; Russian plural forms (few/many) are not covered, but this is the same deferred pluralization trade-off noted in the PR.
src/shared/i18n/locales/ru/kanban.ts Complete translation of all kanban keys including status, card actions, modals, and error messages; structurally aligned with English.
src/shared/i18n/locales/ru/constants.ts Largest translation file (~224 lines); covers provider labels, API key fields, gateway platform labels — translations are accurate and consistent.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[types.ts\nAppLocale union] -->|'ru' added| B[config.ts\nAPP_LOCALES array]
    B --> C[Settings.tsx\nLanguage picker]
    A --> D[index.ts\nresources object]
    D --> E[ru/common.ts\nru/navigation.ts\nru/welcome.ts\n+ 20 more modules]
    D --> F[index.test.ts\nKey-parity test\nru ↔ en]
Loading

Reviews (3): Last reviewed commit: "fix(i18n): align Russian app name" | Re-trigger Greptile

create: "Создать",
active: "Активен",
noModel: "Модель не выбрана",
skillsCount: "Навыков: {{count}}",

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.

P2 Genitive-plural form is incorrect for count = 1

"Навыков: {{count}}" uses the genitive plural and will render as "Навыков: 1", which is ungrammatical in Russian. The correct forms are "1 навык" (1), "2 навыка" (2–4), and "5 навыков" (5+). The same pattern appears in memory.ts with entries: "Записей: {{count}}". The PR notes this is deferred to a future i18n-architecture change, which is reasonable, but it's worth tracking as a known user-facing rough edge for Russian speakers.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@SilentBob347

Copy link
Copy Markdown

pls make

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