Repository navigation
[Maintainer] i18n: migrate left rail, level selector and layers panel - #1173
Conversation
…ialogs Converts the icon rail, plugin panel shell, site/layers tree, zone and items panels, the floating level selector and the duplicate-level dialog to runtime descriptors. Layer rows fall back to the node kind's translated label and localized level names; generated default names (room, slab, roof, stair...) and counts use whole ICU messages. messageWithSlot keeps the delete-level confirmation one sentence around the bold level name.
… literal baseline
…s fit translations Expand/collapse chevrons, rename pencils, row delete buttons, colour dots and level option buttons get accessible names; the level menus grow up to max-w-72 instead of wrapping longer translations.
…nd level dialog surfaces on a furnished scene
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5bbbf006a6
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // biome-ignore lint/correctness/useExhaustiveDependencies: labels re-translate when the locale changes | ||
| const sidebarTabs = useMemo( | ||
| () => SIDEBAR_TABS.map((tab) => ({ ...tab, label: i18n._(tab.label) })), | ||
| [i18n, locale], |
There was a problem hiding this comment.
Recompute sidebar labels after catalog refreshes
When a host registers or overrides messages after SceneEditor mounts—such as the documented asynchronous registerMessages path—usePascalI18n() triggers a render but retains the same i18n object and locale string. This memo therefore reuses the old labels, leaving the desktop rail and mobile tabs in fallback English or with stale overrides while the rest of the UI updates. Translate these descriptors on each render or include the i18n catalog version in the dependencies.
Useful? React with 👍 / 👎.
…evel rename placeholder Keying the tab-label memo on the catalog version picks up messages registered after mount, not only locale switches. The floating selector's inline rename placeholder now matches the localized row name.
|
Tooling cross-review at b5e932d: APPROVE I checked this locally at /tmp, at the head commit (branched from main at ee8d567). Required CI is green: quality, cli-smoke, Changed paths and Bugbot all pass. mcp-ci doesn't run because no core, MCP or scene-API files change.
P2 (doesn't block)
Security isn't needed. |
Conflicts in the literal baseline and compiled catalogs resolved by regenerating them with i18n:extract and i18n:literals update.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7a5b160. Configure here.
… stored English Bugbot (Low): localizedLevelName re-translates stored defaults like "Ground floor", but both rename fields prefilled that English. They now edit authoredLevelName, with the localized default as the placeholder, and leaving the field unchanged writes nothing.
|
Tooling cross-review at e52d5da: APPROVE I re-confirmed my approval at b5e932d against this head, checked out locally at /tmp. Required CI is green: quality, cli-smoke, Changed paths and Bugbot all pass.
P2 (doesn't block)
Security isn't needed. |
slab-tree-node keeps both sides (localized footprint name and slab default name); the audit manifest keeps both surface sets. Catalogs and the literal baseline are regenerated with i18n:extract and i18n:literals update, with #1173's drafts carried over by ID.

What does this PR do?
Localizes the left side of the editor: the icon rail, the layers (site) panel, the floating level selector and the level dialogs. Part of #621.
SceneEditor. That covers the rail tooltips and aria-labels, the mobile tab bar and the panel headers. The editor's own Site, Settings and Plugins entries are translated too, and a crashed plugin panel shows translated fallback copy.site-panel):node.<kind>.labelmessages throughnodeLabelDescriptor, so they share translations with the build tab. The registry fallback does the same withpresentation.label. Generated names ("Room (12 m²)", "Roof (2 segments)", "Gable (4.0×6.0m)", "Flight / Landing") live insite-panel/default-names.tsas whole ICU messages, with plurals and a roof-type select. The drag preview uses the same names.localizedLevelName, so they read "Ground floor / Floor 1", not the core English helper's output.authoredLevelName), and leaving the field unchanged writes nothing.messageWithSlothelper keeps that confirmation one translatable sentence around the bold level name.{levelName}.aria-expanded;w-max, up tomax-w-72) instead of wrapping longer translations.usePascalI18nimport when the file already imports it in another@pascal-app/coreimport (with a test).site-panel/index.tsxgets'use client'. It already called hooks 57 times, but the codemod's guard read it as a possible server component because the editor barrel re-exports it.fuzzy+Review: required(AI-Provider: cursor-agent), so they show English until a fluent reviewer approves them. The literal baseline drops from 2,592 to 2,436.icon-rail,layers-panel,level-selector,level-menu,duplicate-level-dialoganddelete-level-dialog. They run on a project seeded from the MCPtwo-bedroomtemplate, so the tree and level list have rows. The template's room names are listed asdata.How to test
bun run i18n:check: passes and reports the drafts per locale awaiting review.bun dev, then open a furnished project with?lang=en-XA. The rail tooltips, the Scene panel tree (expand a level and walls), the level pill, its ⋮ menu and both level dialogs should all be bracketed and accented. Rename a level that still has its default name: the field starts empty with the localized name as placeholder.bun run i18n:pseudo-audit -- icon-rail layers-panel level-selector level-menu duplicate-level-dialog delete-level-dialog: all six PASS, with no untranslated strings and no unnamed controls. I ran this, and the full audit: every surface from the earlier PRs still passes. Screenshots below.bun test srcinpackages/editor: 2,670 pass.main: thesrc/i18nand sidebar tests (24 pass, including the newauthoredLevelNametest) andbun test scripts/(130 pass).bun test libinapps/editor: 74 pass.bun run checkreports no findings in the changed files.Still English after this PR
Plugin rail entries (Nature, Environment, WebXR, Pools, Landscape, Bath Space, Streetscape). External plugin packages register these labels, so they're listed as
dataon theicon-railsurface.Row names a definition's
tree.labelreturns. That is plugin and definition API, which returns English.Base-plate footprint names ("Shared floor", "Kitchen floor"). These come from core
floorFootprintName, which MCP also reads; [Maintainer] i18n: migrate properties and inspector panels #1174 adds the structured variant.Unit formatting:
min roof and stair segment sizes;toFixedin area and perimeter.These belong to the units and number-formatting PR.
Other pages and surfaces: the settings panel (its own surface PR), the home and settings pages, and the WebXR "Enter VR" button. These still fail the
home,settingsand whole-editoraudit sweeps.Screenshots / screen recording
en-XA(accented, about 30 % longer, bracketed), captured byi18n:pseudo-auditat 1440×900.Layers panel on the two-bedroom template:
Layers panel en-XA
Icon rail with the Items tooltip:
Icon rail en-XA
Level selector with two levels:
Level selector en-XA
Level row menu (one line per item after the width fix):
Level menu en-XA
Duplicate level dialog:
Duplicate level dialog en-XA
Delete level confirmation (one sentence around the bold level name):
Delete level dialog en-XA
The "2 Issues" badge in the screenshots is the Next dev overlay. Its React "synchronously unmount a root" console error also appears on
mainwith the same furnished scene.Checklist
bun devbun checkto verify)mainbranchTo show artifacts inline, enable in settings.
Note
Low Risk
Mostly string and accessibility copy changes with memoized tab labels; scene graph and level operations behavior are unchanged aside from how names are shown and edited.
Reviewed by Cursor Bugbot for commit e52d5da. Bugbot is set up for automated code reviews on this repo. Configure here.