Skip to content

i18n: add Russian (ru) locale - #1284

Closed
betraalexandr wants to merge 1 commit into
pascalorg:mainfrom
betraalexandr:i18n-add-russian
Closed

betraalexandr wants to merge 1 commit into
pascalorg:mainfrom
betraalexandr:i18n-add-russian

Conversation

@betraalexandr

@betraalexandr betraalexandr commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds Russian (ru) as a bundled locale, following i18n/README.md.

  • packages/editor/src/i18n/locales/ru/messages.po (+ compiled messages.ts): all 3,956 entries translated, marked Review: human.
  • lingui.config.ts, packages/editor/src/i18n/locales.ts, scripts/i18n.ts: ru added to the locale lists.
  • scripts/i18n.test.ts, scripts/i18n-literals.test.ts, packages/editor/src/i18n/locales.test.ts: ru added to the locale lists and the locale-pack test.
  • i18n/glossary.json: Russian forms for ceiling, floor plan, room, unit, wall, walkthrough. (level and scan are left out: Russian needs different words depending on context.)

No copy, component or dependency changes. Plural messages use one / few / many / other.

How it was reviewed: translated with AI assistance using a project glossary, then reviewed in context by a native Russian speaker during daily use of the editor (including item search); marked Review: human. Rare strings (e.g. some error messages) may not have been seen in the UI. Happy to adjust on feedback.

How to test

  1. bun install --frozen-lockfile
  2. bun run i18n:extract leaves no diff; bun run i18n:check passes; bun scripts/i18n.ts check --reviewed reports nothing for ru.
  3. bun test scripts/i18n.test.ts scripts/i18n-literals.test.ts and bun test src/i18n in packages/editor pass.
  4. Open the editor with ?lang=ru.

Screenshots / screen recording

None yet; can add if useful.

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (biome check on the touched files is clean)
  • I've updated relevant documentation (if applicable): none needed
  • This PR targets the main branch

Disclosure: prepared with the help of an AI agent (Claude Code). Run: i18n:extract, i18n:check, i18n:literals -- check, the i18n script tests, the packages/core and packages/editor i18n tests, tsgo --noEmit in packages/editor. Not run: the full bun run ci.

🤖 Generated with Claude Code


Note

Low Risk
Adds translations and config only; no runtime logic, security, or data-handling changes.

Overview
Adds Russian (ru) as a shipped bundled language across the Lingui/i18n pipeline.

lingui.config.ts, scripts/i18n.ts, and packages/editor/src/i18n/locales.ts now include ru in locale lists and register compiled ru messages with the editor pack. i18n/glossary.json gains Russian architectural terms (e.g. room, wall, floor plan, unit) so tooling stays consistent with other locales.

Tests in locales.test.ts, i18n.test.ts, and i18n-literals.test.ts assert Russian coverage alongside existing target locales. Use ?lang=ru to run the editor in Russian once the catalog files are present in the branch.

Reviewed by Cursor Bugbot for commit 57c2b8e. Bugbot is set up for automated code reviews on this repo. Configure here.

Adds ru following i18n/README.md: all 3,956 entries translated and reviewed
(Review: human), registered in lingui.config.ts, the bundled locale list,
scripts/i18n.ts and the i18n tests, plus Russian glossary terms
(ceiling, floor plan, room, unit, wall, walkthrough).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Copy link
Copy Markdown
Member

Thanks @betraalexandr! This follows the "bundle another language" steps in i18n/README.md (config, locales.ts, glossary, the locale-pack test), and keeping every draft fuzzy / Review: required is right. Unreviewed entries aren't compiled, so the shipped ru pack stays empty until a native speaker reviews.

Two things:

  1. main has moved since this was cut. Please rebase and rerun bun run i18n:extract so the catalog matches current source and bun run i18n:check passes (new strings come in as untranslated).
  2. Are you a Russian speaker able to review entries? A pack only becomes useful once entries are Review: human. A first reviewed batch (navbar, toolbar, Build panel) with a ?lang=ru screenshot would make this much easier to land.

CI for this fork is waiting on maintainer approval to run.

@Aymericr Aymericr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[Maintainer] Reviewed at 57c2b8e.

The wiring follows i18n/README.md (ru in lingui.config.ts, TARGET_LOCALES, bundledLocalePacks, glossary, and the locale-pack test). I counted 3,956 entries, all marked Review: human and none fuzzy, which matches the description.

I spot-checked architectural terms and they read as considered Russian, not raw machine output: Wall → Стена, Rooms → Комнаты, Ceiling → Потолок, Floor plan → План этажа, Site → Участок (not «сайт»), Slab → Плита перекрытия, Unit → Помещение (the glossary sense, not a measurement unit), Gate → Калитка, Walkthrough → Прогулка, Share → Поделиться. Display settings → Настройки отображения matches the test.

One consistency issue to look at: Level is «Уровень» in some inspector strings and «Этаж» in the site panel, which is exactly why the glossary left level untranslated. Please pick one sense per UI surface (storey vs. generic level) before this ships.

Not approving for merge yet:

  1. Rebase and re-extract. main has grown since this was cut (3,956 here vs about 3.96k+ now). New strings should come in as Review: required until you review them; please do not bulk-mark them human.
  2. Screenshot of ?lang=ru (navbar, Build panel, a dialog) is still missing.
  3. CI has not run on this head (fork workflow waiting for approval: CI run 43631868730).

Translation quality of the existing pack looks good enough to approve after 1–2.

@Aymericr Aymericr added the bot:tooling label Dec 2, 2026 — with Cursor

Aymericr commented Dec 3, 2026

Copy link
Copy Markdown
Member

Review at 57c2b8ed, run with Codex (gpt-6.2-astra) over two rounds: a full review, then each finding re-checked against the diff. Only findings that survived are listed.

  • P2 — packages/editor/src/i18n/locales/ru/messages.po:1149: The translator notes define ID and OD as distances between wall faces. Внутр. Ø, Наруж. Ø, and Внутр. + наруж. Ø instead denote diameters. Replace them with Внутр. размер, Наруж. размер, and Оба размера, respectively.
  • P2 — packages/editor/src/i18n/locales/ru/messages.po:7697: For boards running “out from the house,” the source puts the joists “along it” (the house). The Russian other branch puts them вдоль досок (along the boards). Change вдоль досок to вдоль дома in that branch only.
  • P2 — packages/editor/src/i18n/locales/ru/messages.po:13294: The cabinet card says Стиральная машина (clothes washer), while both node.cabinet.preset.dishwasher and the compartment summary’s dishwasher branch say Посудомоечная машина. Use Посудомоечная машина on the card.
  • P3 — packages/editor/src/i18n/locales/ru/messages.po:56: остаются частью своего забора says the openings remain part of their fence, but omits where to find them: “under their fence in the scene graph.” Replace only the second sentence with В дереве сцены калитки и проёмы находятся под соответствующим забором. Regenerate the compiled Russian catalog after the PO fixes.
  • P3 — packages/editor/src/i18n/locales.test.ts:16: The new ru expectation checks only Настройки отображения and Комнаты; it does not exercise plural selection. Add runtime assertions for app.lib.buildPanelModel.toolCount: 1 инструмент, 2 инструмента, 5 инструментов, and 21 инструмент.

P0/P1: 0. CI hasn't run on this fork PR yet because it needs a maintainer to approve the workflow run; it merges once that's green.

@Aymericr Aymericr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[Maintainer] Re-checked at 57c2b8e against current main (9c00a41), which now has the #1310 lazy loader and the Italian locale (#1200) as the pattern. Reviewed with Codex (gpt-6.2-astra) in two rounds: a full review, then every claim re-verified against the code. No new push since my last review, and the branch now conflicts, so I can't run CI on it yet.

P1 — Russian is not wired into the lazy loader. The PR only adds ru to the eager bundledLocalePacks. The app loads catalogs through loadBundledLocale() (apps/editor/app/layout.tsx:44). On main, ru-RU resolves to null (lazy-locales.ts:38), so Russian would never load and the UI would stay English. The PR's test registers every pack by hand, so it wouldn't catch this.

What to change (model: #1200, edb4ba2f):

  1. Rebase onto main and resolve the six conflicts:
    • lingui.config.ts, scripts/i18n.ts, scripts/i18n.test.ts, scripts/i18n-literals.test.ts: keep main. They now read the shared lists from scripts/i18n-locales.ts, so don't restore literal arrays (the old ones omit it).
    • packages/editor/src/i18n/locales.ts: keep main's imports and registration loop. Add only the ru messages import and ru: { locale: 'ru', messages: ru }.
    • i18n/glossary.json: keep main's Italian values and notes. Merge your Russian values for ceiling, floor plan, room, wall and walkthrough, plus the new unit entry and its note.
  2. Lazy loader: in packages/editor/src/i18n/lazy-locales.ts, add 'ru' to BUNDLED_LOCALES and case 'ru': return (await import('./locales/ru/messages')).messages in importLocaleMessages. No resolver change is needed.
  3. Per-locale entry: add packages/editor/src/i18n/locales/ru/index.ts (copy locales/it/index.ts: locale, messages, registerLocale()), plus "./locales/ru": "./src/i18n/locales/ru/index.ts" in packages/editor/package.json.
  4. Tooling registry: append 'ru' to TARGET_LOCALES in scripts/i18n-locales.ts. Add it to PREVIEW_LOCALES only if you want Russian to ship as a preview with drafts. Otherwise check --reviewed will fail on the drafts from step 5.
  5. Re-extract: keep your ru/messages.po and run bun run i18n:extract. Against current main it lacks 224 IDs, has 1 retired (node.item.panel.info), and 3 editor.actionMenu.pointAskButton.* entries whose English changed. New empty entries come in as Review: missing. Fill them as fuzzy + Review: required; don't mark them human. Then run bun run i18n:compile and bun run i18n:check.
  6. Tests (locales.test.ts auto-merges): keep your Настройки отображения / Комнаты assertions, add ru to the sorted pack-key list, and add ru-RU → ru, an isolated registerLocale() test, and a loadBundledLocale('ru-RU') test that serves Russian without loading other locales.
  7. README: i18n/README.md:200 ("To bundle another language") is stale. Please describe the shared target list, lazy loader, per-locale entry and package export instead of a literal Lingui edit.

Still open from my earlier review: pick one sense per surface for Level («Уровень» vs «Этаж»), and add a ?lang=ru screenshot of the reviewed surfaces.

No P0 found in the non-catalog diff. Once the above is in and CI is green at the new head, I'm happy to approve and merge. I'm not pushing to your fork.

Aymericr added a commit that referenced this pull request Dec 4, 2026
…912) (#1357)

Ports #1284 (Russian locale, wired through the lazy locale loader like #1200; 227 new strings as fuzzy / Review: required drafts) and #912 (store assets as raw bytes in IndexedDB; legacy File/Blob records still load).

Co-authored-by: Aleksandr Betra <69962782+betraalexandr@users.noreply.github.com>
Co-authored-by: Duhan K <157699651+DoudouDoudouk@users.noreply.github.com>

Aymericr commented Dec 4, 2026

Copy link
Copy Markdown
Member

Thank you @betraalexandr! Your Russian locale has landed on main in #1357 (squash commit 730f00a), with you credited as co-author. It's wired through the lazy locale loader like Italian. Your 3,952 reviewed entries ship as written. The 224 strings added since your branch, plus the 3 whose English changed to "Comment", come in as fuzzy / Review: required drafts and show in English until reviewed. Russian is a preview locale for now.

Left out of #1357, and welcome as follow-up PRs:

  • the translation fixes suggested in review (ID/OD, joists, the dishwasher card, the gate hint)
  • choosing «Уровень» or «Этаж» for "Level" and using it consistently on each surface
  • updating the i18n README section on bundling another language
  • a ?lang=ru screenshot of the reviewed surfaces
  • reviewing the 227 drafts, so they can be marked Review: human

Closing this as landed. Thanks again!

@Aymericr Aymericr closed this Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants