Skip to content

feat: add russian machine translation - #331

Open
neolegshishov wants to merge 2 commits into
Anyesh:mainfrom
neolegshishov:main
Open

neolegshishov wants to merge 2 commits into
Anyesh:mainfrom
neolegshishov:main

Conversation

@neolegshishov

@neolegshishov neolegshishov commented Nov 11, 2026 •

Copy link
Copy Markdown

Description

Add comprehensive Russian (ru) locale translations to the frontend i18n catalog.

Related Issue

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/CD or build changes

Checklist

  • I have read the CONTRIBUTING guide
  • My code follows the project's coding style
  • I have added tests that prove my fix/feature works
  • New and existing tests pass locally
  • I have updated documentation as needed
  • My changes don't introduce new warnings or errors

Testing

Test Environment

  • Docker Compose
  • Kubernetes
  • Local development

Tests Performed

  • npm run i18n:keys — OK: every t() call resolves (1420 keys in catalog, 1038 referenced from source)
  • npm run i18n:parity — OK: 9 locales checked, all ICU placeholders preserved, no missing or extra keys
  • npm run i18n:scan — 5 hardcoded strings in source code only (not translation issues): app/layout.tsx, components/ui/dialog.tsx, lib/auth.ts

Screenshots (if applicable)

Additional Notes

  • Russian locale now has 17 namespace files, matching the full English catalog structure
  • All ICU plural format expressions are correctly translated with proper Russian grammar rules
  • The i18n:scan reports 5 hardcoded strings in TSX/TS source — these are not translation file issues

Summary by Sourcery

Add comprehensive Russian localization across the frontend and localized AI responses.

New Features:

  • Add Russian as a supported frontend locale with complete translations across all application namespaces.
  • Enable Russian localization for backend AI-generated responses.

@sourcery-ai

sourcery-ai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Data structures

Register Russian in the locale catalogs and metadata so the application can recognize it as a supported locale.

  • backend/app/data/locales.json L3
  • frontend/lib/generated/locales.ts L3
  • frontend/lib/i18n/locales.ts L23

Implementation

Add Russian to the language-name mapping used by the AI service.

  • backend/app/services/ai_service.py L97

UI

Add Russian translations across all 17 frontend message namespaces so users can view the application in Russian.

  • frontend/messages/ru/analytics.json L1-69
  • frontend/messages/ru/common.json L1-78
  • frontend/messages/ru/constants.json L1-284
  • frontend/messages/ru/dashboard.json L1-66
  • frontend/messages/ru/errors.json L1-13
  • frontend/messages/ru/family.json L1-97
  • frontend/messages/ru/history.json L1-41
  • frontend/messages/ru/learning.json L1-94
  • frontend/messages/ru/nav.json L1-24
  • frontend/messages/ru/notifications.json L1-99
  • frontend/messages/ru/onboarding.json L1-80
  • frontend/messages/ru/outfits.json L1-174
  • frontend/messages/ru/pairings.json L1-36
  • frontend/messages/ru/settings.json L1-148
  • frontend/messages/ru/suggest.json L1-106
  • frontend/messages/ru/wardrobe.json L1-328

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions github-actions Bot added javascript Pull requests that update javascript code python Pull requests that update python code labels Nov 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your first pull request to Wardrowbe! Please make sure you've read the CONTRIBUTING guide, especially the PR title format section. A maintainer will review this soon.

@neolegshishov neolegshishov changed the title russian machine translation feat: add russian machine translation Nov 11, 2026

@sourcery-ai sourcery-ai Bot 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.

Hey - I've found 8 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="frontend/lib/i18n/locales.ts" line_range="23" />
<code_context>
   fr: { name: 'French', nativeName: 'Français', dir: 'ltr' },
   de: { name: 'German', nativeName: 'Deutsch', dir: 'ltr' },
   it: { name: 'Italian', nativeName: 'Italiano', dir: 'ltr' },
+  ru: { name: 'Russian', nativeName: 'Русский', dir: 'ltr' },
 };

</code_context>
<issue_to_address>
**Russian AI descriptions use English**

When the backend locale-parity test runs or a Russian user's item image is analyzed, `DESCRIPTION_LANGUAGES` has no `ru` entry, so `analyze_image` falls back to English and the locale-parity test fails; Russian users receive English descriptions.

Add a Russian entry to `DESCRIPTION_LANGUAGES` so Russian descriptions are generated and every supported locale has a mapping.
</issue_to_address>

### Comment 2
<location path="frontend/lib/i18n/locales.ts" line_range="23" />
<code_context>
   fr: { name: 'French', nativeName: 'Français', dir: 'ltr' },
   de: { name: 'German', nativeName: 'Deutsch', dir: 'ltr' },
   it: { name: 'Italian', nativeName: 'Italiano', dir: 'ltr' },
+  ru: { name: 'Russian', nativeName: 'Русский', dir: 'ltr' },
 };

</code_context>
<issue_to_address>
**Never-worn insight fails to render**

When a Russian never-worn insight is formatted with a count that has no matching plural option, `insightNeverWorn` uses `другие` instead of the required ICU `other` selector, so formatting fails and the insight is not displayed.

Replace the `другие` plural selector in `insightNeverWorn` with the ICU `other` selector.
</issue_to_address>

### Comment 3
<location path="frontend/lib/i18n/locales.ts" line_range="23" />
<code_context>
   fr: { name: 'French', nativeName: 'Français', dir: 'ltr' },
   de: { name: 'German', nativeName: 'Deutsch', dir: 'ltr' },
   it: { name: 'Italian', nativeName: 'Italiano', dir: 'ltr' },
+  ru: { name: 'Russian', nativeName: 'Русский', dir: 'ltr' },
 };

</code_context>
<issue_to_address>
**Russian counts use incorrect word forms**

When a Russian pluralized message formats a count in the `few` or `many` category, russian plural messages generally define only `one` and `other`, so counts in `few` or `many` use the `other` wording and display incorrect noun forms, such as `2 предметов` instead of `2 предмета`.

Add appropriate `few` and `many` forms to the Russian plural messages.
</issue_to_address>

### Comment 4
<location path="frontend/lib/i18n/locales.ts" line_range="23" />
<code_context>
   fr: { name: 'French', nativeName: 'Français', dir: 'ltr' },
   de: { name: 'German', nativeName: 'Deutsch', dir: 'ltr' },
   it: { name: 'Italian', nativeName: 'Italiano', dir: 'ltr' },
+  ru: { name: 'Russian', nativeName: 'Русский', dir: 'ltr' },
 };

</code_context>
<issue_to_address>
**Russian analytics labels mislead users**

When a Russian user views analytics, the Russian labels for `neverWorn.title`, `totalWears.title`, and `outfitsGenerated.title` are mistranslated, so users see meanings such as “Never gave birth,” “Total socks,” and “Generated forms” instead of accurate analytics labels.

Correct the Russian translations for the never-worn, total-wears, and outfits-generated analytics titles.
</issue_to_address>

### Comment 5
<location path="frontend/lib/i18n/locales.ts" line_range="23" />
<code_context>
   fr: { name: 'French', nativeName: 'Français', dir: 'ltr' },
   de: { name: 'German', nativeName: 'Deutsch', dir: 'ltr' },
   it: { name: 'Italian', nativeName: 'Italiano', dir: 'ltr' },
+  ru: { name: 'Russian', nativeName: 'Русский', dir: 'ltr' },
 };

</code_context>
<issue_to_address>
**Russian setup instructions are corrupted**

When a Russian user opens login while no authentication method is configured, the Russian unconfigured-login message replaces the `<code>` tags and environment-variable names with `KEEP` markers and spaced text, so users see unusable setup instructions instead of the required configuration values.

Restore the exact environment-variable names and wrap them in the corresponding `<code>` tags in the Russian message.
</issue_to_address>

### Comment 6
<location path="frontend/lib/i18n/locales.ts" line_range="23" />
<code_context>
   fr: { name: 'French', nativeName: 'Français', dir: 'ltr' },
   de: { name: 'German', nativeName: 'Deutsch', dir: 'ltr' },
   it: { name: 'Italian', nativeName: 'Italiano', dir: 'ltr' },
+  ru: { name: 'Russian', nativeName: 'Русский', dir: 'ltr' },
 };

</code_context>
<issue_to_address>
**Development warning loses security meaning**

When a Russian user sees the development login form, the Russian `devMode` text says “Development Mode - All accepted documents,” rather than warning that any credentials are accepted. Russian users therefore do not receive the warning's authentication meaning on the development login form.

Translate the warning to explicitly state that any credentials are accepted.
</issue_to_address>

### Comment 7
<location path="frontend/lib/i18n/locales.ts" line_range="23" />
<code_context>
   fr: { name: 'French', nativeName: 'Français', dir: 'ltr' },
   de: { name: 'German', nativeName: 'Deutsch', dir: 'ltr' },
   it: { name: 'Italian', nativeName: 'Italiano', dir: 'ltr' },
+  ru: { name: 'Russian', nativeName: 'Русский', dir: 'ltr' },
 };

</code_context>
<issue_to_address>
**Login progress says “subscribing”**

When a Russian user submits the login form and sign-in is in progress, the Russian `signingIn` text means “subscribing,” not “signing in.” While authentication is in progress, the login button therefore tells Russian users that they are subscribing.

Replace the text with a Russian phrase meaning “Signing in…”.
</issue_to_address>

### Comment 8
<location path="frontend/lib/i18n/locales.ts" line_range="23" />
<code_context>
   fr: { name: 'French', nativeName: 'Français', dir: 'ltr' },
   de: { name: 'German', nativeName: 'Deutsch', dir: 'ltr' },
   it: { name: 'Italian', nativeName: 'Italiano', dir: 'ltr' },
+  ru: { name: 'Russian', nativeName: 'Русский', dir: 'ltr' },
 };

</code_context>
<issue_to_address>
**Russian home page loses product name**

When a Russian visitor opens the home page, the Russian `auth.brandName` translates the product name as `гардероб`, while the navigation translation retains `wardrowbe`. The home page uses `auth.brandName` as its visible heading and logo alt text, so Russian visitors see a generic word instead of the product name.

Keep the product name unchanged in `auth.brandName`, consistently with the navigation translation.
</issue_to_address>

Sourcery assessment

Approval pending. 8 findings to address first.

Blocking findings: frontend/lib/i18n/locales.ts:23, frontend/lib/i18n/locales.ts:23, frontend/lib/i18n/locales.ts:23, frontend/lib/i18n/locales.ts:23, frontend/lib/i18n/locales.ts:23, and 3 more


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread frontend/lib/i18n/locales.ts Resolved
fr: { name: 'French', nativeName: 'Français', dir: 'ltr' },
de: { name: 'German', nativeName: 'Deutsch', dir: 'ltr' },
it: { name: 'Italian', nativeName: 'Italiano', dir: 'ltr' },
ru: { name: 'Russian', nativeName: 'Русский', dir: 'ltr' },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 High · Never-worn insight fails to render

When a Russian never-worn insight is formatted with a count that has no matching plural option, insightNeverWorn uses другие instead of the required ICU other selector, so formatting fails and the insight is not displayed.

Replace the другие plural selector in insightNeverWorn with the ICU other selector.

Prompt for AI agents
In `frontend/lib/i18n/locales.ts` at line 23:

**Never-worn insight fails to render**

When a Russian never-worn insight is formatted with a count that has no matching plural option, `insightNeverWorn` uses `другие` instead of the required ICU `other` selector, so formatting fails and the insight is not displayed.

Replace the `другие` plural selector in `insightNeverWorn` with the ICU `other` selector.

fr: { name: 'French', nativeName: 'Français', dir: 'ltr' },
de: { name: 'German', nativeName: 'Deutsch', dir: 'ltr' },
it: { name: 'Italian', nativeName: 'Italiano', dir: 'ltr' },
ru: { name: 'Russian', nativeName: 'Русский', dir: 'ltr' },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 High · Russian counts use incorrect word forms

When a Russian pluralized message formats a count in the few or many category, russian plural messages generally define only one and other, so counts in few or many use the other wording and display incorrect noun forms, such as 2 предметов instead of 2 предмета.

Add appropriate few and many forms to the Russian plural messages.

Prompt for AI agents
In `frontend/lib/i18n/locales.ts` at line 23:

**Russian counts use incorrect word forms**

When a Russian pluralized message formats a count in the `few` or `many` category, russian plural messages generally define only `one` and `other`, so counts in `few` or `many` use the `other` wording and display incorrect noun forms, such as `2 предметов` instead of `2 предмета`.

Add appropriate `few` and `many` forms to the Russian plural messages.

fr: { name: 'French', nativeName: 'Français', dir: 'ltr' },
de: { name: 'German', nativeName: 'Deutsch', dir: 'ltr' },
it: { name: 'Italian', nativeName: 'Italiano', dir: 'ltr' },
ru: { name: 'Russian', nativeName: 'Русский', dir: 'ltr' },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · Russian analytics labels mislead users

When a Russian user views analytics, the Russian labels for neverWorn.title, totalWears.title, and outfitsGenerated.title are mistranslated, so users see meanings such as “Never gave birth,” “Total socks,” and “Generated forms” instead of accurate analytics labels.

Correct the Russian translations for the never-worn, total-wears, and outfits-generated analytics titles.

Prompt for AI agents
In `frontend/lib/i18n/locales.ts` at line 23:

**Russian analytics labels mislead users**

When a Russian user views analytics, the Russian labels for `neverWorn.title`, `totalWears.title`, and `outfitsGenerated.title` are mistranslated, so users see meanings such as “Never gave birth,” “Total socks,” and “Generated forms” instead of accurate analytics labels.

Correct the Russian translations for the never-worn, total-wears, and outfits-generated analytics titles.

fr: { name: 'French', nativeName: 'Français', dir: 'ltr' },
de: { name: 'German', nativeName: 'Deutsch', dir: 'ltr' },
it: { name: 'Italian', nativeName: 'Italiano', dir: 'ltr' },
ru: { name: 'Russian', nativeName: 'Русский', dir: 'ltr' },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · Russian setup instructions are corrupted

When a Russian user opens login while no authentication method is configured, the Russian unconfigured-login message replaces the <code> tags and environment-variable names with KEEP markers and spaced text, so users see unusable setup instructions instead of the required configuration values.

Restore the exact environment-variable names and wrap them in the corresponding <code> tags in the Russian message.

Prompt for AI agents
In `frontend/lib/i18n/locales.ts` at line 23:

**Russian setup instructions are corrupted**

When a Russian user opens login while no authentication method is configured, the Russian unconfigured-login message replaces the `<code>` tags and environment-variable names with `KEEP` markers and spaced text, so users see unusable setup instructions instead of the required configuration values.

Restore the exact environment-variable names and wrap them in the corresponding `<code>` tags in the Russian message.

fr: { name: 'French', nativeName: 'Français', dir: 'ltr' },
de: { name: 'German', nativeName: 'Deutsch', dir: 'ltr' },
it: { name: 'Italian', nativeName: 'Italiano', dir: 'ltr' },
ru: { name: 'Russian', nativeName: 'Русский', dir: 'ltr' },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · Development warning loses security meaning

When a Russian user sees the development login form, the Russian devMode text says “Development Mode - All accepted documents,” rather than warning that any credentials are accepted. Russian users therefore do not receive the warning's authentication meaning on the development login form.

Translate the warning to explicitly state that any credentials are accepted.

Prompt for AI agents
In `frontend/lib/i18n/locales.ts` at line 23:

**Development warning loses security meaning**

When a Russian user sees the development login form, the Russian `devMode` text says “Development Mode - All accepted documents,” rather than warning that any credentials are accepted. Russian users therefore do not receive the warning's authentication meaning on the development login form.

Translate the warning to explicitly state that any credentials are accepted.

fr: { name: 'French', nativeName: 'Français', dir: 'ltr' },
de: { name: 'German', nativeName: 'Deutsch', dir: 'ltr' },
it: { name: 'Italian', nativeName: 'Italiano', dir: 'ltr' },
ru: { name: 'Russian', nativeName: 'Русский', dir: 'ltr' },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · Login progress says “subscribing”

When a Russian user submits the login form and sign-in is in progress, the Russian signingIn text means “subscribing,” not “signing in.” While authentication is in progress, the login button therefore tells Russian users that they are subscribing.

Replace the text with a Russian phrase meaning “Signing in…”.

Prompt for AI agents
In `frontend/lib/i18n/locales.ts` at line 23:

**Login progress says “subscribing”**

When a Russian user submits the login form and sign-in is in progress, the Russian `signingIn` text means “subscribing,” not “signing in.” While authentication is in progress, the login button therefore tells Russian users that they are subscribing.

Replace the text with a Russian phrase meaning “Signing in…”.

fr: { name: 'French', nativeName: 'Français', dir: 'ltr' },
de: { name: 'German', nativeName: 'Deutsch', dir: 'ltr' },
it: { name: 'Italian', nativeName: 'Italiano', dir: 'ltr' },
ru: { name: 'Russian', nativeName: 'Русский', dir: 'ltr' },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · Russian home page loses product name

When a Russian visitor opens the home page, the Russian auth.brandName translates the product name as гардероб, while the navigation translation retains wardrowbe. The home page uses auth.brandName as its visible heading and logo alt text, so Russian visitors see a generic word instead of the product name.

Keep the product name unchanged in auth.brandName, consistently with the navigation translation.

Prompt for AI agents
In `frontend/lib/i18n/locales.ts` at line 23:

**Russian home page loses product name**

When a Russian visitor opens the home page, the Russian `auth.brandName` translates the product name as `гардероб`, while the navigation translation retains `wardrowbe`. The home page uses `auth.brandName` as its visible heading and logo alt text, so Russian visitors see a generic word instead of the product name.

Keep the product name unchanged in `auth.brandName`, consistently with the navigation translation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update javascript code python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants