Skip to content

add russian translation#177

Merged
bl-ue merged 5 commits intoPiebald-AI:mainfrom
vanja-san:ru-translation
Jan 15, 2026
Merged

add russian translation#177
bl-ue merged 5 commits intoPiebald-AI:mainfrom
vanja-san:ru-translation

Conversation

@vanja-san
Copy link
Copy Markdown
Contributor

@vanja-san vanja-san commented Dec 26, 2025

Summary by CodeRabbit

  • New Features

    • Russian language support added — full UI localization and selectable Russian option in settings.
  • Documentation

    • Feature list updated to include Russian as a supported UI language.

✏️ Tip: You can customize this high-level summary in your review settings.

@mike1858
Copy link
Copy Markdown
Member

Thank you!

@mike1858 mike1858 enabled auto-merge (squash) December 26, 2025 21:02
@mike1858 mike1858 disabled auto-merge December 26, 2025 21:25
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 10, 2026

📝 Walkthrough

Walkthrough

Adds Russian ("ru") localization: config and type-guards updated, UI exposes the new option, README updated, and a new comprehensive Russian translation file added; a minor Windows-specific import removal in backend lib.rs was also made.

Changes

Cohort / File(s) Summary
I18n configuration & guards
frontend/src/i18n/config.ts, frontend/src/i18n/index.ts
supportedLanguages extended to include "ru"; languageNames mapping includes "ru": "Русский"; isValidLanguage() updated to validate against the dynamic supportedLanguages.
Russian translation resource
frontend/src/i18n/locales/ru/translation.json
New Russian translation JSON (≈559 lines) containing localized UI strings, pluralization keys, and template placeholders across multiple UI areas.
Settings UI
frontend/src/components/common/SettingsDialog.tsx
Language selector options updated to include a "ru" / Русский entry.
Documentation
README.md
Multi-language UI feature list updated to include Russian.
Backend minor import change
crates/backend/src/lib.rs
Removed Windows-specific CommandExt trait import (small code cleanup).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰🌿 Я — зайчик кода, рад вам сообщить:
"Русский" в сборке — всё заговорит.
Файлы дописаны, флаги в ряд,
Теперь UI шепчет «Привет» и «Почитай» — ура! 🥕🇷🇺

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'add russian translation' clearly and accurately summarizes the main change—adding Russian localization support across multiple files including translation configuration, UI components, and translation resources.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

🧹 Recent nitpick comments
frontend/src/i18n/index.ts (1)

21-28: Consider reusing languageNames from config.

The names mapping duplicates languageNames already exported from config.ts (line 5). You could simplify this function:

♻️ Suggested refactor
+import { supportedLanguages, languageNames, type SupportedLanguage } from "./config";
-import { supportedLanguages, type SupportedLanguage } from "./config";

 // Export language display utility
 export const getLanguageDisplayName = (lang: SupportedLanguage): string => {
-  const names: Record<SupportedLanguage, string> = {
-    en: "English",
-    "zh-CN": "简体中文",
-    "zh-TW": "繁體中文",
-    ru: "Русский",
-  };
-  return names[lang];
+  return languageNames[lang];
 };
frontend/src/components/common/SettingsDialog.tsx (1)

251-256: Optional: Consider generating language options dynamically.

The language options are hardcoded, requiring updates in multiple places when adding new languages. You could generate them from the centralized config:

♻️ Suggested refactor
import { supportedLanguages, languageNames } from "@/i18n";

// In the component:
<SelectContent>
  {supportedLanguages.map((lang) => (
    <SelectItem key={lang} value={lang}>
      {languageNames[lang]}
    </SelectItem>
  ))}
</SelectContent>

This is an existing pattern, so no action needed for this PR—just a suggestion for future maintainability.


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e2982f3 and 1c1e4f0.

📒 Files selected for processing (4)
  • README.md
  • crates/backend/src/lib.rs
  • frontend/src/components/common/SettingsDialog.tsx
  • frontend/src/i18n/index.ts
💤 Files with no reviewable changes (1)
  • crates/backend/src/lib.rs
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Enable strict mode in TypeScript code for maximum type safety
Apply ESLint rules with React and accessibility plugins to TypeScript code
Format TypeScript code with Prettier for consistent style
Organize imports and use path aliases in TypeScript code

Files:

  • frontend/src/components/common/SettingsDialog.tsx
  • frontend/src/i18n/index.ts
frontend/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

frontend/src/**/*.{ts,tsx}: Apply component composition over inheritance pattern in TypeScript/React code
Implement i18n support in React frontend with react-i18next using component-level translations with hooks, translation interpolation, and pluralization support

Files:

  • frontend/src/components/common/SettingsDialog.tsx
  • frontend/src/i18n/index.ts
frontend/**/*.{ts,tsx,json}

📄 CodeRabbit inference engine (CLAUDE.md)

Use React version 19.1.1 and TypeScript version 5.9.2 in frontend development

Files:

  • frontend/src/components/common/SettingsDialog.tsx
  • frontend/src/i18n/index.ts
frontend/**/*.{css,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Use Tailwind CSS version 4.1.12 with @tailwindcss/vite plugin for styling in frontend code

Files:

  • frontend/src/components/common/SettingsDialog.tsx
frontend/src/i18n/**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Implement browser language detection with automatic fallback and persistent language preferences stored in localStorage in frontend i18n

Files:

  • frontend/src/i18n/index.ts
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: Piebald-AI/gemini-cli-desktop PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-01T02:32:21.277Z
Learning: Applies to frontend/src/i18n/locales/**/*.json : Support English, Simplified Chinese (zh-CN), and Traditional Chinese (zh-TW) translations in frontend internationalization
Learnt from: CR
Repo: Piebald-AI/gemini-cli-desktop PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-01T02:32:21.277Z
Learning: Applies to frontend/src/i18n/**/*.ts : Implement browser language detection with automatic fallback and persistent language preferences stored in localStorage in frontend i18n
📚 Learning: 2026-01-01T02:32:21.277Z
Learnt from: CR
Repo: Piebald-AI/gemini-cli-desktop PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-01T02:32:21.277Z
Learning: Applies to frontend/src/i18n/locales/**/*.json : Support English, Simplified Chinese (zh-CN), and Traditional Chinese (zh-TW) translations in frontend internationalization

Applied to files:

  • README.md
  • frontend/src/components/common/SettingsDialog.tsx
  • frontend/src/i18n/index.ts
📚 Learning: 2026-01-01T02:32:21.277Z
Learnt from: CR
Repo: Piebald-AI/gemini-cli-desktop PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-01T02:32:21.277Z
Learning: Applies to frontend/src/i18n/**/*.ts : Implement browser language detection with automatic fallback and persistent language preferences stored in localStorage in frontend i18n

Applied to files:

  • frontend/src/components/common/SettingsDialog.tsx
  • frontend/src/i18n/index.ts
📚 Learning: 2026-01-01T02:32:21.277Z
Learnt from: CR
Repo: Piebald-AI/gemini-cli-desktop PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-01T02:32:21.277Z
Learning: Applies to frontend/src/**/*.{ts,tsx} : Implement i18n support in React frontend with react-i18next using component-level translations with hooks, translation interpolation, and pluralization support

Applied to files:

  • frontend/src/components/common/SettingsDialog.tsx
  • frontend/src/i18n/index.ts
🧬 Code graph analysis (2)
frontend/src/components/common/SettingsDialog.tsx (1)
frontend/src/components/ui/select.tsx (1)
  • SelectItem (176-176)
frontend/src/i18n/index.ts (2)
frontend/src/i18n/config.ts (2)
  • SupportedLanguage (13-13)
  • supportedLanguages (12-12)
frontend/src/contexts/LanguageContext.tsx (2)
  • SupportedLanguage (92-92)
  • supportedLanguages (94-94)
🔇 Additional comments (3)
README.md (1)

73-73: LGTM!

The documentation correctly reflects the addition of Russian language support, consistent with the i18n configuration changes.

frontend/src/i18n/index.ts (1)

12-17: Good fix for the DRY violation.

The isValidLanguage function now correctly uses the centralized supportedLanguages constant from config.ts, addressing the previous review feedback.

frontend/src/components/common/SettingsDialog.tsx (1)

251-256: LGTM!

The Russian language option is correctly added with the proper value (ru) and native label (Русский), consistent with the i18n configuration.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @frontend/src/i18n/index.ts:
- Around line 16-18: The isValidLanguage function currently uses a hardcoded
array; replace that array with the existing supportedLanguages constant
(imported from config.ts) so the type guard uses
supportedLanguages.includes(lang) instead of ["en", "zh-CN", "zh-TW", "ru"];
ensure supportedLanguages has the correct type (SupportedLanguage[]) or cast
appropriately so isValidLanguage: (lang: string): lang is SupportedLanguage
remains a proper type guard.

In @frontend/src/i18n/locales/ru/translation.json:
- Around line 1-559: README.md omits Russian from the supported languages list
even though frontend/src/i18n/locales/ru/translation.json provides a complete
Russian translation (locale "ru"); update the documentation to include Russian.
Edit the README.md section that lists supported languages (the line mentioning
"English, Chinese (Simplified & Traditional)") and add "Russian (ru)" or
"Russian" so it matches the implemented locale; ensure the README references the
locale code "ru" where other locales are listed.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between be1eb80 and e2982f3.

📒 Files selected for processing (3)
  • frontend/src/i18n/config.ts
  • frontend/src/i18n/index.ts
  • frontend/src/i18n/locales/ru/translation.json
🧰 Additional context used
📓 Path-based instructions (5)
frontend/src/i18n/locales/**/*.json

📄 CodeRabbit inference engine (CLAUDE.md)

Support English, Simplified Chinese (zh-CN), and Traditional Chinese (zh-TW) translations in frontend internationalization

Files:

  • frontend/src/i18n/locales/ru/translation.json
frontend/**/*.{ts,tsx,json}

📄 CodeRabbit inference engine (CLAUDE.md)

Use React version 19.1.1 and TypeScript version 5.9.2 in frontend development

Files:

  • frontend/src/i18n/locales/ru/translation.json
  • frontend/src/i18n/index.ts
  • frontend/src/i18n/config.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Enable strict mode in TypeScript code for maximum type safety
Apply ESLint rules with React and accessibility plugins to TypeScript code
Format TypeScript code with Prettier for consistent style
Organize imports and use path aliases in TypeScript code

Files:

  • frontend/src/i18n/index.ts
  • frontend/src/i18n/config.ts
frontend/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

frontend/src/**/*.{ts,tsx}: Apply component composition over inheritance pattern in TypeScript/React code
Implement i18n support in React frontend with react-i18next using component-level translations with hooks, translation interpolation, and pluralization support

Files:

  • frontend/src/i18n/index.ts
  • frontend/src/i18n/config.ts
frontend/src/i18n/**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Implement browser language detection with automatic fallback and persistent language preferences stored in localStorage in frontend i18n

Files:

  • frontend/src/i18n/index.ts
  • frontend/src/i18n/config.ts
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: Piebald-AI/gemini-cli-desktop PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-01T02:32:21.277Z
Learning: Applies to frontend/src/i18n/locales/**/*.json : Support English, Simplified Chinese (zh-CN), and Traditional Chinese (zh-TW) translations in frontend internationalization
Learnt from: CR
Repo: Piebald-AI/gemini-cli-desktop PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-01T02:32:21.277Z
Learning: Applies to frontend/src/**/*.{ts,tsx} : Implement i18n support in React frontend with react-i18next using component-level translations with hooks, translation interpolation, and pluralization support
Learnt from: CR
Repo: Piebald-AI/gemini-cli-desktop PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-01T02:32:21.277Z
Learning: Applies to frontend/src/i18n/**/*.ts : Implement browser language detection with automatic fallback and persistent language preferences stored in localStorage in frontend i18n
📚 Learning: 2026-01-01T02:32:21.277Z
Learnt from: CR
Repo: Piebald-AI/gemini-cli-desktop PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-01T02:32:21.277Z
Learning: Applies to frontend/src/i18n/locales/**/*.json : Support English, Simplified Chinese (zh-CN), and Traditional Chinese (zh-TW) translations in frontend internationalization

Applied to files:

  • frontend/src/i18n/locales/ru/translation.json
  • frontend/src/i18n/index.ts
  • frontend/src/i18n/config.ts
📚 Learning: 2026-01-01T02:32:21.277Z
Learnt from: CR
Repo: Piebald-AI/gemini-cli-desktop PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-01T02:32:21.277Z
Learning: Applies to frontend/src/**/*.{ts,tsx} : Implement i18n support in React frontend with react-i18next using component-level translations with hooks, translation interpolation, and pluralization support

Applied to files:

  • frontend/src/i18n/locales/ru/translation.json
  • frontend/src/i18n/index.ts
  • frontend/src/i18n/config.ts
📚 Learning: 2026-01-01T02:32:21.277Z
Learnt from: CR
Repo: Piebald-AI/gemini-cli-desktop PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-01T02:32:21.277Z
Learning: Applies to frontend/src/i18n/**/*.ts : Implement browser language detection with automatic fallback and persistent language preferences stored in localStorage in frontend i18n

Applied to files:

  • frontend/src/i18n/locales/ru/translation.json
  • frontend/src/i18n/index.ts
  • frontend/src/i18n/config.ts
🧬 Code graph analysis (1)
frontend/src/i18n/index.ts (2)
frontend/src/i18n/config.ts (1)
  • SupportedLanguage (13-13)
frontend/src/contexts/LanguageContext.tsx (1)
  • SupportedLanguage (92-92)
🔇 Additional comments (5)
frontend/src/i18n/index.ts (1)

22-28: LGTM!

The explicit Record<SupportedLanguage, string> type annotation improves type safety and ensures all supported languages have display names. The Russian display name "Русский" is correctly added.

frontend/src/i18n/config.ts (4)

9-9: LGTM!

The Russian translation import is correctly added and follows the existing pattern for other language imports.


12-12: LGTM!

The supportedLanguages array is correctly extended to include "ru", maintaining type safety through the as const assertion.


16-21: LGTM!

The languageNames mapping correctly includes the Russian display name "Русский" and maintains the Record<SupportedLanguage, string> type constraint.


34-36: LGTM!

The Russian translation resources are properly registered following the existing pattern for other languages.

Copy link
Copy Markdown
Member

@bl-ue bl-ue left a comment

Choose a reason for hiding this comment

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

Thank you @vanja-san! I tested it, and while I can't read Russian, the UI looks good!

@bl-ue bl-ue merged commit 6acc0f4 into Piebald-AI:main Jan 15, 2026
2 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.

3 participants