Skip to content

[Maintainer] Land Russian locale (#1284) and raw-byte asset storage (#912) - #1357

Merged
Aymericr merged 5 commits into
mainfrom
cursor/land-ru-locale-raw-asset-bytes-36a4
Dec 4, 2026
Merged

Aymericr merged 5 commits into
mainfrom
cursor/land-ru-locale-raw-asset-bytes-36a4

Conversation

@Aymericr

@Aymericr Aymericr commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Lands two approved contributor PRs on current main, with credit to their authors in Co-authored-by trailers. When this merges, #1284 and #912 will be closed as landed, with credit. Their fork branches were not touched.

Russian locale, from #1284 by @betraalexandr. Russian is wired in the same way Italian was in #1200 (edb4ba2f):

  • ru is added to TARGET_LOCALES in scripts/i18n-locales.ts and, like it, to PREVIEW_LOCALES.
  • It gets a per-locale entry point, packages/editor/src/i18n/locales/ru/index.ts, and the ./locales/ru package export.
  • It is registered in bundledLocalePacks (locales.ts) and added to BUNDLED_LOCALES, with a lazy import('./locales/ru/messages') case in lazy-locales.ts. ru and ru-RU both resolve to ru, and the app loads the catalog on demand through loadBundledLocale.
  • The contributor's catalog is included as written, along with their Russian glossary terms (ceiling, floor plan, room, wall, walkthrough, and a new unit entry). Main's Italian glossary values are kept.

The catalog was re-extracted against current main with i18n:extract and compiled with i18n:compile. 3,952 of the contributor's entries keep their Review: human status. 227 entries are new AI drafts, marked fuzzy + Review: required with AI-Provider/AI-Model, the same way #1200 marks drafts. They are:

  • the 224 IDs added since the contributor's branch;
  • the three editor.actionMenu.pointAskButton.* strings, whose English changed from "Point and ask" to "Comment".

None of the drafts is shipped as approved. The compiled pack shows them in English until a native speaker reviews them. The retired node.item.panel.info entry is dropped.

The drafts went through the repo's own translate command, using a temporary local provider that served my translations (not committed; scripts/i18n.ts is unchanged). That command validates ICU syntax, placeholders, plural branches and glossary terms before writing.

Raw-byte asset storage, from #912 by @DoudouDoudouk. saveAsset now stores { assetVersion: 1, bytes, type } in IndexedDB instead of the File object, which WebKit rejects. The only conflict was the saveAsset hunk: it keeps main's randomId() with the PR's raw-bytes record. loadAssetUrl still reads existing File/Blob records, and it returns null for a record it can't read instead of throwing.

Test timeout. The release-check tests in scripts/i18n-literals.test.ts copy every real catalog into a throwaway git repo, so they slow down with each bundled locale. On CI, one of them already took 3–4 s on main, and with ru it went over bun's 5 s default. Those six tests now use the 60 s timeout that scripts/i18n.test.ts already uses for its catalog-heavy tests.

Not changed here: the translation fixes suggested in review on #1284 (ID/OD, joists, dishwasher card, gate hint), the «Уровень»/«Этаж» consistency question, and the README "bundle another language" section.

How to test

  1. bun run i18n:check passes and reports ru 227 awaiting review. bun scripts/i18n.ts check --reviewed reports nothing for ru, which is a preview locale like it.
  2. cd packages/editor && bun test src/i18n. The new tests check that ru/ru-RU resolve to ru, that the ru entry point registers only Russian, and that loadBundledLocale('ru-RU') loads only Russian. They also check that reviewed strings come out in Russian, that plurals render correctly (1 инструмент, 2 инструмента, 5 инструментов, 21 инструмент), and that a draft (node.hedge.label) falls back to English.
  3. cd packages/core && bun test src/lib/asset-storage.test.ts. A saved asset is stored as raw bytes plus its type, a legacy Blob record still loads, and an unreadable record returns null.
  4. Open the editor with ?lang=ru: reviewed copy shows in Russian, and the new garden/lawn/robot strings show in English.

Run locally: bun run check, bun run lint, bun run check-types, bun run i18n:check, bun run test and bun run build, all passing on 5bb6a4c1. After the timeout change, bun run test:i18n-scripts and Biome on the changed test file also pass.

Screenshots / screen recording

Not added yet.

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

Ports #1284 and #912.

Open in Web Open in Cursor 

Note

Medium Risk
Asset load/save behavior changes affect local uploads across browsers; Russian ships as a preview locale so unreviewed strings fall back to English rather than blocking release.

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

cursoragent and others added 3 commits December 4, 2026 05:52
saveAsset stored the File itself, which some engines (WebKit) reject as an
IndexedDB value. It now stores { assetVersion: 1, bytes, type }, keyed by
main's randomId(). loadAssetUrl rebuilds a Blob from that record, still reads
File/Blob records written before this change, and returns null for an
unreadable record instead of throwing.

Ported from #912 onto current main.

Co-authored-by: Duhan K <157699651+DoudouDoudouk@users.noreply.github.com>
The contributor's ru catalog (3,956 entries, reviewed in context by a native
speaker and marked Review: human) and Russian glossary terms for ceiling,
floor plan, room, wall and walkthrough, plus a new unit entry. Not wired up
yet.

Co-authored-by: Aleksandr Betra <69962782+betraalexandr@users.noreply.github.com>
Wired the way Italian was in #1200: ru joins the shared target list as a
preview locale, gets a per-locale entry point and package export, and loads
on demand through loadBundledLocale, so ru and ru-RU resolve to ru.

Re-extracted against current main: 224 new IDs and the three Comment
strings whose English changed come in as fuzzy + Review: required AI drafts,
so the compiled pack shows them in English until a native speaker reviews
them. The retired node.item.panel.info entry is dropped.

Ported from #1284 onto current main.

Co-authored-by: Aleksandr Betra <69962782+betraalexandr@users.noreply.github.com>
@Aymericr Aymericr added the bot:maintainer label Dec 4, 2026 — with Cursor
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-04T06:10:11.200959Z 5bb6a4c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

These tests commit every real catalog into a throwaway git repository and run
release-check against it, so their time grows with each bundled locale. On
CI the explicit-base test already took 3-4 s on main and passed 5 s once ru
was added. Match the 60 s timeout scripts/i18n.test.ts uses for its
catalog-heavy tests.

Co-authored-by: Aymeric Rabot <Aymericr@users.noreply.github.com>

@Aymericr Aymericr left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

[Maintainer] Reviewed at 37cc3a158c2bf3e17991c1a82f8ada4cc9538be0 with Codex (gpt-6.2-astra) in two rounds: a full review, then each finding re-verified against the code (including running the i18n and asset tests and runtime probes). P0/P1: 0. The last commit after the reviewed 5bb6a4c1 only raises six release-check test timeouts to 60 s in scripts/i18n-literals.test.ts; I re-read that diff and there are no other changes. I also ran my local CI replica (lint, i18n, skills, types, tests, build, render-bundle, smoke, mcp, viewer-live) on a merge of this head with current main, and everything passes.

Russian wiring matches #1200.

  • ru is in BUNDLED_LOCALES with its lazy import('./locales/ru/messages') case, in bundledLocalePacks, in locales/ru/index.ts (registerLocale()), in the ./locales/ru export, and in TARGET_LOCALES and PREVIEW_LOCALES.
  • ru and ru-RU both resolve to ru, and the lazy path serves Russian strings and plurals. Main's Italian glossary values are preserved.

Drafts fall back to English.

  • Of 4,179 current IDs, exactly 3,952 compile. Every compiled entry is Review: human, non-fuzzy, with the current source hash.
  • All 227 fuzzy + Review: required drafts are absent from the compiled pack. This includes all three pointAskButton.* IDs, which render the English "Comment" wording.
  • After loadBundledLocale('ru-RU'), all 227 draft lookups matched English at runtime.
  • The repo validator found zero ICU, placeholder or glossary errors. All 38 plural IDs carry one/few/many/other branches. Recompiling gave a byte-identical pack.

Asset storage. saveAsset keeps randomId() and the existing key and URL format, and stores { assetVersion: 1, bytes, type }. With a fake IndexedDB, a legacy File, a legacy Blob and a new v1 record each served the exact bytes and MIME type. Read and write failures reject on the write side and return null on the read side. Existing callers in editor and viewer are unchanged.

Non-blocking follow-ups (P2/P3):

  • P2: asset-storage.ts:50 reads the whole file into memory before the IndexedDB write, and the local scan path accepts files up to 200 MiB. Under memory pressure this can fail at the read step. Consider trying the native File write first and falling back to bytes (as I suggested on #912).
  • P3: the asset round-trip tests (asset-storage.test.ts:45, :65) only assert the blob: prefix. Fetching the URL and asserting its body and content type would catch a broken reconstruction.
  • P3: i18n/README.md:104 says check --reviewed fails on every draft, but previews such as it and ru are exempt. ru/messages.po:51 drops the "in the scene graph" navigation hint.

Review-only follow-ups for #1284 (translation fixes suggested earlier, the «Уровень» vs «Этаж» choice for "Level", the README section, a ?lang=ru screenshot) are intentionally left out of this PR. Merge is pending GitHub CI at this head.

Co-authored-by: Aymeric Rabot <Aymericr@users.noreply.github.com>
@Aymericr
Aymericr merged commit 730f00a into main Dec 4, 2026
9 checks passed
@Aymericr
Aymericr deleted the cursor/land-ru-locale-raw-asset-bytes-36a4 branch December 4, 2026 06:39
wass08 added a commit that referenced this pull request Dec 4, 2026
The Russian locale (#1357) landed just before #1356, so the element inspector labels,
the keep-motion setting and the element node names had no Russian entries and
i18n:check failed on main. They are added as fuzzy drafts awaiting review, shown in
English until approved, like the other locales.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wass08 added a commit that referenced this pull request Dec 4, 2026
* core: undo and redo keep each build's generated images

SceneDocument history replayed recorded patches as they were authored. Two regressions
followed from replacing the temporal store (#1356):

- Redo after an authored source edit lost the images captured for the new build: the
  capture is an ignored-history annotation, so the recorded forward patch predated it.
  Replay now captures matching live images into the return patches before each step and
  adopts them once the step succeeds, without adding a history step for captures.
- Undoing a delete restored images belonging to another build: replayed creates bypassed
  the build-image rule. History replay now filters created and updated nodes through
  withSceneNodeBuildImages, which retainSceneAnnotations also uses, so one function owns
  build matching and live-before-carried precedence. Ordinary patch application is
  unchanged.

Tests cover both scenarios, repeated traversal, exact emitted patches and inverses,
captures while undone, creation restore, and grouped and multi-step history.

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

* i18n: Russian drafts for the general-core strings

The Russian locale (#1357) landed just before #1356, so the element inspector labels,
the keep-motion setting and the element node names had no Russian entries and
i18n:check failed on main. They are added as fuzzy drafts awaiting review, shown in
English until approved, like the other locales.

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

* core: explicit image removals apply; load-time store writes are queued

- applySceneOperationPatch forwards explicit source.images writes and removals to the
  document transaction, so a host journal rollback that removes generated images applies
  instead of being turned into an authored source write that keeps same-build images.
  Ordinary authored same-build source edits still keep their images, and explicit
  replacement of existing images now works too.
- Store writes requested from a load notification were silently dropped. They are now
  queued and applied in order, after the load and its history reset, in one published
  ignored-history transaction; functional setState updaters see the preceding queued
  changes, and a failed initialization rolls back and throws to the load caller.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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