Skip to content

[Maintainer] i18n: tooling follow-ups - #1172

Merged
Aymericr merged 5 commits into
mainfrom
cursor/i18n-tooling-followups-6d7c
Oct 27, 2026
Merged

Aymericr merged 5 commits into
mainfrom
cursor/i18n-tooling-followups-6d7c

Conversation

@Aymericr

@Aymericr Aymericr commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Follow-ups from Tooling's review of #1167/#1171 and two Bugbot Lows from #1171. Part of #621.

  • Paint-scope chip (Bugbot Low): the chip label, accessible name and tooltip no longer interpolate an English verb into a shared message. They are now whole messages: Pick: {scope}, Erase: {scope}, Paint: {scope}, Erase scope: {scope}, Paint scope: {scope}, and one "… scope — click or press Shift to cycle" per verb.
  • Reference floor list (Bugbot Low): the level offset is one ICU message, {count} below, instead of a number followed by a separate below, so translators control word order.
  • Build search: the tool search matches the English tool name as well as the translated one, so an English term still finds the tool in a French or Japanese UI.
  • Plugin hint IDs: editor.toolHint.* IDs came from the first six words of the English hint. A plugin hint whose opening matched a built-in hint would have taken the built-in's translation.
    • Every hint and key ID now ends with a short FNV-1a hash of the whole English message (editor.toolHint.cancel.<hash>), in the generator and the runtime lookup alike.
    • The existing drafts moved to the new IDs by their English. They are still drafts, so the regression check is unaffected.
  • Literal guard: the children of <style> and <script> elements are code, not copy, so point-ask-layer.tsx's CALM_CSS stylesheet is no longer baselined. There is a test.
  • Faster tests: the catalog-check and source-drift tests in scripts/i18n.test.ts ran Lingui over the whole repository, taking 45.8 s and 23.0 s. They now run the real check/extract commands on a two-message temporary project via I18N_ROOT, in 3.5 s and 2.6 s. The definition sidecar is skipped in a checkout without the built-in nodes.

Undeclared renames stay warnings. A new ID that shares English with a removed reviewed ID is still reported as a possible rename in the console and job summary, not failed. Identical English can be an unrelated addition: #1169 alone had 31 strings shared across 64 IDs. A missed carry-over only falls back to English, and failing would push contributors toward marking translations Review: human without review. Declared renames (comment: 'renamed-from: <old id>') are still carried over by i18n:extract and enforced by CI.

How to test

  1. bun run i18n:check: passes and reports 727 drafts per locale (8 new paint-scope and {count} below messages, minus the 2 they replace).
  2. bun test ./scripts/i18n.test.ts: 9 pass in about 6 s.
  3. bun test ./scripts/i18n-literals.test.ts, including the new <style>/<script> case. That suite plus the helper and editor i18n tests: 57 pass.
  4. bun dev, then with ?lang=fr search the Build tab for wall: the wall tool is found.
  5. In Paint mode with a material, hover a wall in ?lang=en-XA. The scope chip reads [Þáîñţ: … ~~], and its tooltip is one pseudo-localized message.

Screenshots / screen recording

N/A — tooling and message-shape changes; the affected surfaces render as before.

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
Open in Web Open in Cursor 

Note

Low Risk
Changes are limited to copy, search UX, and i18n tooling; hint ID renames refresh drafts but do not alter runtime business logic beyond safer translations.

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

…nce floors

The paint chip's label, accessible name and tooltip no longer interpolate
an English verb, and the reference floor offset is one ICU message so
translators control the word order.
IDs from the first six words let a plugin hint take a built-in hint's
translation when their openings matched. Each editor.toolHint.* ID now ends
with a short hash of the full English. The drafts moved with their English.
point-ask-layer.tsx's CALM_CSS stylesheet is no longer baselined.
…oject

They ran Lingui over the whole repository (about 45 s and 23 s). They now
run the real check/extract commands on a two-message project via I18N_ROOT,
in about 3 s each. The definition sidecar is skipped in a checkout without
the built-in nodes.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T06:53:02.827616Z 33cc104 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.

@Aymericr Aymericr added the bot:maintainer label Oct 27, 2026 — with Cursor

Copy link
Copy Markdown
Member Author

Tooling cross-review at 33cc104: 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.

My P2s

  • CSS baselined as copy: fixed. The scanner now skips the children of <style> and <script> elements, but still visits their attributes. Three CSS-only baseline entries are removed (point-ask-layer, tree-node-drag and the floor-plan open-wall-ends layer), and there's a test for it. Literal candidates go from 2592 to 2589.
  • Slow tests: fixed. bun test scripts/i18n.test.ts scripts/i18n-literals.test.ts drops from about 75s to 11.5s, with 54 passing. Both rewritten tests still run the real check and extract commands, now on a two-message temp project. The source-drift test still expects a failure first, then a fuzzy Review: required entry that's left out of the pack. The real catalogs are still checked by i18n:check in CI.
  • Build search: fixed. It now matches the translated label or the English label.message.
  • Six-word hint collision: fixed. Hint and key ids now end with an FNV-1a hash of the whole message, in both the generator (which imports the same node-messages.ts) and the runtime lookup. i18n:check confirms the generated file is in sync.
    • The ids changed only on drafts: main has 0 reviewed editor.toolHint.* entries in any locale, so no reviewed translation is renamed.
  • Bugbot Lows: fixed.
    • The paint chip now uses whole messages per verb (Pick: {scope}, Erase: {scope}, Paint: {scope}), plus separate aria-label and tooltip messages.
    • The reference-floor label is one ICU message, {count} below.
  • Grid no-break space and view-id lookup: unchanged. Both were notes, not defects, so no change is needed.

Undeclared renames

  • The reason is acceptable. Same English often belongs to an unrelated id (31 strings shared across 64 ids in [Maintainer] i18n: migrate navbar and top bar #1169), and failing on it would push people to mark translations Review: human without reviewing them.
  • A reviewed translation still can't disappear silently: CI warns on the console and in the job summary, and a declared renamed-from: is still enforced.

No gate got looser

  • No workflow changes, and scripts/i18n.ts (regression check, leak check, release-check) is unchanged.
  • The i18n-literals.ts change is only the style/script skip, and the baseline update path and allowlist ratchet are unchanged.
  • checkDefinitionMessages now skips only when packages/nodes/src/index.ts doesn't exist, as in the temp test project.
  • I repeated my reproduction: fr core.level.basement turned into a draft and recompiled. The default release-check still exits 1.
  • i18n:check passes with 727 drafts per locale, release-check passes against origin/main, and packages/editor passes all 2670 tests.

P2 (doesn't block)

  • The checkDefinitionMessages skip when the nodes entry is missing is a small escape hatch. It's harmless today, but it could be narrowed to the I18N_ROOT test case.

Security isn't needed.

@Aymericr
Aymericr merged commit c0284b6 into main Oct 27, 2026
4 checks passed
@Aymericr
Aymericr deleted the cursor/i18n-tooling-followups-6d7c branch October 27, 2026 12:19
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