Repository navigation
fix: replace lobe-i18n with source-aware in-house locale pipeline - #15062
Conversation
🌐 Website E2ETip All tests passed.
|
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 1801 passed, 0 failed · 5 flaky📊 Browser Reports
📦 Bundle: 8.84 MB gzip ⚪ 0 BDetailsSummary
Category Glance App Entry Points — 3.71 kB (baseline 3.71 kB) • ⚪ 0 BMain entry bundles and manifests Status: 1 unchanged Graph Workspace — 1.37 MB (baseline 1.37 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration Status: 3 unchanged Views & Navigation — 124 kB (baseline 124 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces Status: 17 unchanged Panels & Settings — 565 kB (baseline 565 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens Status: 26 unchanged User & Accounts — 27.2 kB (baseline 27.2 kB) • ⚪ 0 BAuthentication, profile, and account management bundles Status: 11 unchanged Editors & Dialogs — 125 kB (baseline 125 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors Status: 8 unchanged UI Components — 67.1 kB (baseline 67.1 kB) • ⚪ 0 BReusable component library chunks Status: 14 unchanged Data & Services — 3.51 MB (baseline 3.51 MB) • ⚪ 0 BStores, services, APIs, and repositories Status: 17 unchanged Utilities & Hooks — 550 kB (baseline 550 kB) • ⚪ 0 BHelpers, composables, and utility bundles Status: 38 unchanged Vendor & Third-Party — 16.8 MB (baseline 16.8 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 18 unchanged Other — 14.2 MB (baseline 14.2 MB) • ⚪ 0 BBundles that do not match a named category Status: 286 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-08-13T03:04:53.780Z",
"gitSha": "0542bdf4ce719cbff3bdee16b941a8ae05d913af",
"branch": "bl/in-house-i18n-pipeline-1b91ce",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2138.8810000000262,
"styleRecalcs": 11,
"styleRecalcDurationMs": 10.584999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 581.6600000000001,
"heapDeltaBytes": 5840016,
"heapUsedBytes": 70682252,
"domNodes": 22,
"jsHeapTotalBytes": 24379392,
"scriptDurationMs": 19.006,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 2051.624000000004,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.686000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 452.48,
"heapDeltaBytes": 5855052,
"heapUsedBytes": 70662804,
"domNodes": 18,
"jsHeapTotalBytes": 24641536,
"scriptDurationMs": 16.32,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1846.7920000000504,
"styleRecalcs": 73,
"styleRecalcDurationMs": 37.286,
"layouts": 12,
"layoutDurationMs": 3.71,
"taskDurationMs": 873.371,
"heapDeltaBytes": -16252088,
"heapUsedBytes": 48474448,
"domNodes": -283,
"jsHeapTotalBytes": 23564288,
"scriptDurationMs": 120.149,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1841.0420000000158,
"styleRecalcs": 75,
"styleRecalcDurationMs": 40.01499999999999,
"layouts": 12,
"layoutDurationMs": 3.5789999999999997,
"taskDurationMs": 834.333,
"heapDeltaBytes": 427416,
"heapUsedBytes": 65206400,
"domNodes": 57,
"jsHeapTotalBytes": 24641536,
"scriptDurationMs": 120.70199999999998,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1755.7090000000244,
"styleRecalcs": 33,
"styleRecalcDurationMs": 16.281999999999996,
"layouts": 6,
"layoutDurationMs": 0.49700000000000005,
"taskDurationMs": 379.21000000000004,
"heapDeltaBytes": 8746708,
"heapUsedBytes": 73613112,
"domNodes": 78,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 18.177,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1756.055999999944,
"styleRecalcs": 32,
"styleRecalcDurationMs": 16.869000000000003,
"layouts": 6,
"layoutDurationMs": 0.6280000000000001,
"taskDurationMs": 377.21099999999996,
"heapDeltaBytes": 8558756,
"heapUsedBytes": 73290968,
"domNodes": 78,
"jsHeapTotalBytes": 24641536,
"scriptDurationMs": 18.474,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 578.9439999999786,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.401,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 370.128,
"heapDeltaBytes": -11296540,
"heapUsedBytes": 53491352,
"domNodes": 18,
"jsHeapTotalBytes": 25952256,
"scriptDurationMs": 59.120999999999995,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 576.3500000000477,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.2219999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 377.563,
"heapDeltaBytes": -11382380,
"heapUsedBytes": 53657828,
"domNodes": 18,
"jsHeapTotalBytes": 25952256,
"scriptDurationMs": 59.538999999999994,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2022.5059999999644,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.128,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 660.898,
"heapDeltaBytes": 6710180,
"heapUsedBytes": 66652028,
"domNodes": -282,
"jsHeapTotalBytes": 3768320,
"scriptDurationMs": 100.08,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2041.868999999906,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.530000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 669.542,
"heapDeltaBytes": 6999216,
"heapUsedBytes": 66755976,
"domNodes": -280,
"jsHeapTotalBytes": 2719744,
"scriptDurationMs": 101.841,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2158.976999999993,
"styleRecalcs": 69,
"styleRecalcDurationMs": 14.355999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1265.623,
"heapDeltaBytes": 1984220,
"heapUsedBytes": 62996688,
"domNodes": -283,
"jsHeapTotalBytes": 3174400,
"scriptDurationMs": 424.20199999999994,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2163.6989999999514,
"styleRecalcs": 69,
"styleRecalcDurationMs": 13.437999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1254.4719999999998,
"heapDeltaBytes": 1174304,
"heapUsedBytes": 62077736,
"domNodes": -285,
"jsHeapTotalBytes": 3960832,
"scriptDurationMs": 417.561,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3278.377999999975,
"styleRecalcs": 66,
"styleRecalcDurationMs": 15.469,
"layouts": 60,
"layoutDurationMs": 6.968999999999999,
"taskDurationMs": 1521.8709999999999,
"heapDeltaBytes": 1568196,
"heapUsedBytes": 63809816,
"domNodes": -286,
"jsHeapTotalBytes": 5865472,
"scriptDurationMs": 531.999,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 3147.5090000000137,
"styleRecalcs": 64,
"styleRecalcDurationMs": 13.479999999999999,
"layouts": 60,
"layoutDurationMs": 7.025,
"taskDurationMs": 1416.4399999999998,
"heapDeltaBytes": 23940224,
"heapUsedBytes": 87163892,
"domNodes": 10,
"jsHeapTotalBytes": 7864320,
"scriptDurationMs": 511.49199999999996,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "minimap-idle",
"durationMs": 2016.8790000000172,
"styleRecalcs": 7,
"styleRecalcDurationMs": 5.989000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 658.4689999999999,
"heapDeltaBytes": 6354484,
"heapUsedBytes": 67172736,
"domNodes": -287,
"jsHeapTotalBytes": 4030464,
"scriptDurationMs": 101.493,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2045.739000000026,
"styleRecalcs": 7,
"styleRecalcDurationMs": 6.075,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 658.563,
"heapDeltaBytes": 6919144,
"heapUsedBytes": 67897144,
"domNodes": -286,
"jsHeapTotalBytes": 4554752,
"scriptDurationMs": 102.045,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 595.5539999999928,
"styleRecalcs": 45,
"styleRecalcDurationMs": 9.099000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 387.066,
"heapDeltaBytes": -10289280,
"heapUsedBytes": 54478644,
"domNodes": 16,
"jsHeapTotalBytes": 25952256,
"scriptDurationMs": 120.26200000000001,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 589.2949999999928,
"styleRecalcs": 48,
"styleRecalcDurationMs": 10.723,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 391.992,
"heapDeltaBytes": -11015760,
"heapUsedBytes": 53930732,
"domNodes": 22,
"jsHeapTotalBytes": 25690112,
"scriptDurationMs": 118.763,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2028.0680000000189,
"styleRecalcs": 11,
"styleRecalcDurationMs": 8.612000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 461.0690000000001,
"heapDeltaBytes": 5902476,
"heapUsedBytes": 70498548,
"domNodes": 22,
"jsHeapTotalBytes": 25165824,
"scriptDurationMs": 13.434000000000001,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-idle",
"durationMs": 2005.213000000026,
"styleRecalcs": 10,
"styleRecalcDurationMs": 9.225,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 446.398,
"heapDeltaBytes": 5889236,
"heapUsedBytes": 70504232,
"domNodes": 20,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 14.003,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1707.9180000000065,
"styleRecalcs": 75,
"styleRecalcDurationMs": 33.724,
"layouts": 16,
"layoutDurationMs": 3.7830000000000004,
"taskDurationMs": 763.875,
"heapDeltaBytes": -3261620,
"heapUsedBytes": 61436380,
"domNodes": 62,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 88.98599999999999,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1711.1830000000054,
"styleRecalcs": 76,
"styleRecalcDurationMs": 34.660000000000004,
"layouts": 16,
"layoutDurationMs": 3.6,
"taskDurationMs": 749.465,
"heapDeltaBytes": -3462116,
"heapUsedBytes": 61447860,
"domNodes": 64,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 89.377,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-transition-enter",
"durationMs": 1384.096999999997,
"styleRecalcs": 18,
"styleRecalcDurationMs": 29.73200000000001,
"layouts": 14,
"layoutDurationMs": 12.464000000000002,
"taskDurationMs": 901.6139999999999,
"heapDeltaBytes": 1436228,
"heapUsedBytes": 73024636,
"domNodes": 13673,
"jsHeapTotalBytes": 15204352,
"scriptDurationMs": 33.87800000000001,
"eventListeners": 2375,
"totalBlockingTimeMs": 141,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8301.328000000012,
"styleRecalcs": 250,
"styleRecalcDurationMs": 36.164,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4402.585,
"heapDeltaBytes": 5778580,
"heapUsedBytes": 65729212,
"domNodes": -282,
"jsHeapTotalBytes": 5533696,
"scriptDurationMs": 1369.932,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "viewport-pan-sweep",
"durationMs": 8194.856000000073,
"styleRecalcs": 250,
"styleRecalcDurationMs": 36.769999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4408.19,
"heapDeltaBytes": 9410156,
"heapUsedBytes": 68672760,
"domNodes": -281,
"jsHeapTotalBytes": 5795840,
"scriptDurationMs": 1359.146,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 16832.524000000034,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16801.476000000002,
"heapDeltaBytes": -50758404,
"heapUsedBytes": 166201708,
"domNodes": -8312,
"jsHeapTotalBytes": -12263424,
"scriptDurationMs": 585.416,
"eventListeners": -16387,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.77333333333336,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 16633.995999999912,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16578.704,
"heapDeltaBytes": -44534896,
"heapUsedBytes": 173680220,
"domNodes": -8317,
"jsHeapTotalBytes": -8855552,
"scriptDurationMs": 581.597,
"eventListeners": -16385,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 20326.04200000003,
"styleRecalcs": 137,
"styleRecalcDurationMs": 15.106999999999982,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20302.506999999998,
"heapDeltaBytes": -40763240,
"heapUsedBytes": 165177848,
"domNodes": -8312,
"jsHeapTotalBytes": -9637888,
"scriptDurationMs": 863.4289999999999,
"eventListeners": -16383,
"totalBlockingTimeMs": 95,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 20304.161999999906,
"styleRecalcs": 138,
"styleRecalcDurationMs": 15.682000000000029,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20268.516,
"heapDeltaBytes": -49119300,
"heapUsedBytes": 177094352,
"domNodes": -8312,
"jsHeapTotalBytes": -9449472,
"scriptDurationMs": 870.617,
"eventListeners": -16385,
"totalBlockingTimeMs": 147,
"frameDurationMs": 17.779999999999927,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 481.2339999999722,
"styleRecalcs": 15,
"styleRecalcDurationMs": 20.344,
"layouts": 3,
"layoutDurationMs": 1.153,
"taskDurationMs": 129.72299999999998,
"heapDeltaBytes": 5074420,
"heapUsedBytes": 69016916,
"domNodes": 126,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 10.562,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "workflow-execution",
"durationMs": 509.2499999999518,
"styleRecalcs": 15,
"styleRecalcDurationMs": 24.122000000000003,
"layouts": 3,
"layoutDurationMs": 0.6229999999999999,
"taskDurationMs": 119.867,
"heapDeltaBytes": 5067260,
"heapUsedBytes": 69030956,
"domNodes": 125,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 9.658000000000001,
"eventListeners": 97,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
}
]
} |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR replaces the external i18n CLI with a Git-aware TypeScript locale pipeline. It adds locale parsing, translation, validation, rebuilding, manifest tracking, offline checks, CI integration, and blobless full-history checkout support. ChangesLocale pipeline
Estimated code review effort: 4 (Complex) | ~60 minutes Mergeability Score: 🟠 High · up to The new locale pipeline can currently delete translations when an English entry file is missing, mishandle manually dispatched workflow branch selection, and accept translations that lose repeated protected tokens. These create concrete data-loss, workflow, and localization-correctness risks, so the PR is not merge-ready until the deletion guard, branch handling, and token-count validation are addressed. Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant updateLocales
participant Git
participant OpenAI
participant LocaleFiles
GitHubActions->>updateLocales: run locale update or check
updateLocales->>Git: load source-manifest blobs and history
updateLocales->>OpenAI: send batched pending translations
OpenAI-->>updateLocales: return JSON translations
updateLocales->>LocaleFiles: validate and write rebuilt locales
LocaleFiles-->>GitHubActions: provide locale integrity status
Possibly related PRs
Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 inconclusive)
✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/i18n/translate.ts`:
- Around line 130-140: Update the fetchFn call in the translation request flow
to include signal: AbortSignal.timeout(120000) in its request options, ensuring
slow OpenAI requests are aborted after two minutes while preserving the existing
catch-based TimeoutError retry behavior.
In `@scripts/i18n/update-locales.test.ts`:
- Around line 208-226: Add a promise-gated Vitest case in the locale translation
tests that passes multiple chunks to translateLocaleItems with
requestConcurrency greater than one, tracks active TranslateBatch calls, and
asserts the maximum active count never exceeds the configured limit while all
translations complete. Keep the test focused on concurrent batch dispatch and
use the existing translation fixtures and helpers.
In `@scripts/i18n/update-locales.ts`:
- Around line 188-199: Update the recorded-source loader around execFileSync and
parseLocale so the try/catch covers only git blob retrieval; parse the returned
content after the try succeeds. Preserve the missing-blob error for retrieval
failures, and attach the caught original error as the Error cause.
- Around line 202-224: The writeManifest flow must hash the same formatted
English locale bytes that are committed. Ensure formatting runs before locale
collection/manifest generation (prefer ordering pnpm format before pnpm locale),
or otherwise format the content before calculating hashes in writeManifest;
preserve manifest serialization and conditional writing behavior.
In `@src/locales/fr/nodeDefs.json`:
- Around line 9147-9148: Update the description value for the latent AV split
node in nodeDefs.json to state “any compatible AV model,” preserving the
existing French wording and display_name unchanged.
In `@src/locales/ko/nodeDefs.json`:
- Line 5985: Update the description string in the relevant node definition to
replace “참조 이미지의 안내에 따라” with wording that means generating the video based on
the reference image, such as “참조 이미지를 기반으로,” while preserving the optional
preset voice-reference behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 054178fb-5657-4eb9-852c-d4b10ca4abe3
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (41)
.github/workflows/i18n-update-core.yaml.github/workflows/i18n-update-custom-nodes.yaml.github/workflows/i18n-update-nodes.yaml.i18nrc.cjs.oxlintrc.jsoneslint.config.tspackage.jsonpnpm-workspace.yamlscripts/i18n/config.tsscripts/i18n/locale-tree.tsscripts/i18n/protected-tokens.tsscripts/i18n/translate.tsscripts/i18n/update-locales.test.tsscripts/i18n/update-locales.tssrc/locales/.source-manifest.jsonsrc/locales/CONTRIBUTING.mdsrc/locales/ar/main.jsonsrc/locales/ar/nodeDefs.jsonsrc/locales/es/main.jsonsrc/locales/es/nodeDefs.jsonsrc/locales/fa/main.jsonsrc/locales/fa/nodeDefs.jsonsrc/locales/fr/main.jsonsrc/locales/fr/nodeDefs.jsonsrc/locales/he/main.jsonsrc/locales/he/nodeDefs.jsonsrc/locales/it/main.jsonsrc/locales/ja/main.jsonsrc/locales/ja/nodeDefs.jsonsrc/locales/ko/main.jsonsrc/locales/ko/nodeDefs.jsonsrc/locales/pt-BR/main.jsonsrc/locales/pt-BR/nodeDefs.jsonsrc/locales/ru/main.jsonsrc/locales/ru/nodeDefs.jsonsrc/locales/tr/main.jsonsrc/locales/tr/nodeDefs.jsonsrc/locales/zh-TW/main.jsonsrc/locales/zh-TW/nodeDefs.jsonsrc/locales/zh/main.jsonsrc/locales/zh/nodeDefs.json
💤 Files with no reviewable changes (4)
- .oxlintrc.json
- pnpm-workspace.yaml
- .i18nrc.cjs
- eslint.config.ts
| "description": "Sépare un latent AV conjoint en ses latents vidéo et audio (tout modèle AV, par ex. LTXV ou MiniMax H3).", | ||
| "display_name": "Séparer le latent AV", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Preserve the compatibility constraint in the description.
The text tout modèle AV means “any AV model.” The intended meaning is “any compatible AV model.” Add compatible so users do not infer that every AV model accepts this latent format.
Proposed wording
- "description": "Sépare un latent AV conjoint en ses latents vidéo et audio (tout modèle AV, par ex. LTXV ou MiniMax H3).",
+ "description": "Sépare un latent AV conjoint en ses latents vidéo et audio (tout modèle AV compatible, par ex. LTXV ou MiniMax H3).",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "description": "Sépare un latent AV conjoint en ses latents vidéo et audio (tout modèle AV, par ex. LTXV ou MiniMax H3).", | |
| "display_name": "Séparer le latent AV", | |
| "description": "Sépare un latent AV conjoint en ses latents vidéo et audio (tout modèle AV compatible, par ex. LTXV ou MiniMax H3).", | |
| "display_name": "Séparer le latent AV", |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/locales/fr/nodeDefs.json` around lines 9147 - 9148, Update the
description value for the latent AV split node in nodeDefs.json to state “any
compatible AV model,” preserving the existing French wording and display_name
unchanged.
| }, | ||
| "GrokVideoReferenceNode": { | ||
| "description": "참조 이미지를 스타일 및 콘텐츠 참조로 사용하여 비디오를 생성합니다.", | ||
| "description": "참조 이미지의 안내에 따라 비디오를 생성하며, 사전 설정된 음성 참조를 선택적으로 사용할 수 있습니다.", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Use wording that describes visual guidance.
참조 이미지의 안내에 따라 implies that the reference image contains instructions. Use wording such as 참조 이미지를 기반으로 to preserve the intended meaning.
Proposed fix
- "description": "참조 이미지의 안내에 따라 비디오를 생성하며, 사전 설정된 음성 참조를 선택적으로 사용할 수 있습니다.",
+ "description": "참조 이미지를 기반으로 비디오를 생성하며, 사전 설정된 음성 참조를 선택적으로 사용할 수 있습니다.",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "description": "참조 이미지의 안내에 따라 비디오를 생성하며, 사전 설정된 음성 참조를 선택적으로 사용할 수 있습니다.", | |
| "description": "참조 이미지를 기반으로 비디오를 생성하며, 사전 설정된 음성 참조를 선택적으로 사용할 수 있습니다.", |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/locales/ko/nodeDefs.json` at line 5985, Update the description string in
the relevant node definition to replace “참조 이미지의 안내에 따라” with wording that means
generating the video based on the reference image, such as “참조 이미지를 기반으로,” while
preserving the optional preset voice-reference behavior.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
scripts/i18n/update-locales.test.ts (1)
145-230: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winAdd coverage for concurrent batch dispatch.
The visible tests only exercise sequential, single-chunk-at-a-time response scenarios. None of them pass multiple chunks with
requestConcurrency > 1totranslateLocaleItems. A regression that exceeds the configured request limit would still pass these tests.Add a promise-gated test. Track active
TranslateBatchcalls. Assert the maximum active count never exceeds the configuredrequestConcurrency. Assert all translations still complete.As per path instructions, review the colocated Vitest coverage for locale pipeline behavior, especially batching and retries.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/i18n/update-locales.test.ts` around lines 145 - 230, Add a Vitest case in the translateLocaleItems suite that supplies enough items for multiple chunks and configures requestConcurrency above one. Use promise-gated TranslateBatch calls to track active requests and record the maximum concurrent count, then release them and assert all translations complete while the maximum never exceeds translationConfig.requestConcurrency. Ensure the test covers concurrent batch dispatch without altering existing retry behavior.Source: Path instructions
♻️ Duplicate comments (1)
src/locales/fr/nodeDefs.json (1)
9142-9144: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winAdd "compatible" to the
LTXVSeparateAVLatentdescription.The text still reads "tout modèle AV" ("any AV model"). A previous review on this exact line range asked to change this to "tout modèle AV compatible" ("any compatible AV model"), because the node supports specific AV models rather than every AV model. That change is not present in the current text.
🐛 Proposed wording
- "description": "Sépare un latent AV conjoint en ses latents vidéo et audio (tout modèle AV, par ex. LTXV ou MiniMax H3).", + "description": "Sépare un latent AV conjoint en ses latents vidéo et audio (tout modèle AV compatible, par ex. LTXV ou MiniMax H3).",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locales/fr/nodeDefs.json` around lines 9142 - 9144, Update the description for LTXVSeparateAVLatent to say “tout modèle AV compatible” instead of “tout modèle AV”, preserving the rest of the French text unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/locales/es/nodeDefs.json`:
- Around line 5966-5968: Restore the missing resolution.tooltip translation
under GrokVideoNode.inputs.resolution in src/locales/es/nodeDefs.json
(5966-5968), src/locales/ar/nodeDefs.json (5966-5968),
src/locales/fa/nodeDefs.json (5966-5968), and src/locales/fr/nodeDefs.json
(5966-5968), using the corresponding translated tooltip defined by the English
locale.
---
Outside diff comments:
In `@scripts/i18n/update-locales.test.ts`:
- Around line 145-230: Add a Vitest case in the translateLocaleItems suite that
supplies enough items for multiple chunks and configures requestConcurrency
above one. Use promise-gated TranslateBatch calls to track active requests and
record the maximum concurrent count, then release them and assert all
translations complete while the maximum never exceeds
translationConfig.requestConcurrency. Ensure the test covers concurrent batch
dispatch without altering existing retry behavior.
---
Duplicate comments:
In `@src/locales/fr/nodeDefs.json`:
- Around line 9142-9144: Update the description for LTXVSeparateAVLatent to say
“tout modèle AV compatible” instead of “tout modèle AV”, preserving the rest of
the French text unchanged.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 102ad7f7-95c8-473b-89cc-276b164a81a6
📒 Files selected for processing (17)
.github/workflows/i18n-update-custom-nodes.yamlscripts/i18n/translate.tsscripts/i18n/update-locales.test.tsscripts/i18n/update-locales.tssrc/locales/ar/nodeDefs.jsonsrc/locales/es/nodeDefs.jsonsrc/locales/fa/nodeDefs.jsonsrc/locales/fr/nodeDefs.jsonsrc/locales/he/nodeDefs.jsonsrc/locales/it/nodeDefs.jsonsrc/locales/ja/nodeDefs.jsonsrc/locales/ko/nodeDefs.jsonsrc/locales/pt-BR/nodeDefs.jsonsrc/locales/ru/nodeDefs.jsonsrc/locales/tr/nodeDefs.jsonsrc/locales/zh-TW/nodeDefs.jsonsrc/locales/zh/nodeDefs.json
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #15062 +/- ##
==========================================
+ Coverage 80.90% 81.12% +0.22%
==========================================
Files 1882 1882
Lines 111804 123862 +12058
Branches 31718 39031 +7313
==========================================
+ Hits 90453 100484 +10031
- Misses 20977 22821 +1844
- Partials 374 557 +183
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
scripts/i18n/translate.ts (1)
103-115: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winPreserve a closed type at the translator boundary.
OpenAiTranslatorOptions.reasoningEffortwidens the configuration union tostring. Arbitrary values can then reachreasoning_effortwithout compile-time protection. Reuse one shared reasoning-effort type. Validate model-specific values beforefetchFnif the factory supports multiple models.As per path instructions:
docs/guidance/typescript.mdrequires precise types and stable helper contracts.Proposed type fix
interface OpenAiTranslatorOptions { apiKey: string model: string - reasoningEffort: string + reasoningEffort: ReasoningEffort glossary: string }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/i18n/translate.ts` around lines 103 - 115, Update OpenAiTranslatorOptions.reasoningEffort and the createOpenAiTranslator request path to use the shared closed reasoning-effort type instead of string, preserving compile-time rejection of arbitrary values. If the factory supports multiple models, validate that the selected effort is supported for the configured model before invoking fetchFn.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/i18n/config.ts`:
- Line 11: Define and export a single ReasoningEffort type aligned with the
selected model’s API contract, then reuse it for
OpenAiTranslatorOptions.reasoningEffort in scripts/i18n/config.ts:11 and the
corresponding reasoning-effort declaration in scripts/i18n/translate.ts:103-115.
Preserve the supported 'max' value and ensure the API boundary no longer widens
the configured literal union to string.
---
Outside diff comments:
In `@scripts/i18n/translate.ts`:
- Around line 103-115: Update OpenAiTranslatorOptions.reasoningEffort and the
createOpenAiTranslator request path to use the shared closed reasoning-effort
type instead of string, preserving compile-time rejection of arbitrary values.
If the factory supports multiple models, validate that the selected effort is
supported for the configured model before invoking fetchFn.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 2365ae98-4c0e-4f5a-aee2-82361351f0c8
📒 Files selected for processing (3)
scripts/i18n/config.tsscripts/i18n/translate.tsscripts/i18n/update-locales.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 832c12d3eb
ℹ️ 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".
| for (const leaf of collectLeaves(state.plan.source).values()) { | ||
| if (typeof leaf.value !== 'string') continue | ||
| if (pendingKeys.has(pathKey(leaf.path))) continue | ||
| if (protectedTokens(leaf.value, false).length === 0) continue |
There was a problem hiding this comment.
Audit placeholders in unchanged locale entries
When the manifest is seeded with existing translations, this false excludes interpolation placeholders from the audit, so corrupted stable entries are permanently treated as valid. This is already observable in pt-BR/main.json: manager.changingVersion replaced {to} with the literal pt-BR, while g.itemsSelected uses {selectedCount} although its callers pass count; nevertheless locale:check reports no violation and normal runs retain both strings. Include interpolation tokens when auditing unchanged leaves so these entries are surfaced or regenerated.
Useful? React with 👍 / 👎.
| /\b\d+k\+\d+\b/g, | ||
| /(?<=['"“”「」])(?:match|max)(?=['"“”「」])/g | ||
| ] | ||
| const interpolationPattern = /(?<!\\)\{[A-Za-z][A-Za-z0-9_.-]*\}/g |
There was a problem hiding this comment.
Recognize numeric list-interpolation placeholders
When a message using Vue I18n list interpolation is regenerated, this pattern does not match placeholders such as {0}, {1}, and {2}. The current English resources use them in linearMode.error.mobileFixable and linearMode.error.getHelp, where <i18n-t> supplies linked components; if a translation drops or renumbers one, it is absent from preserve and tokenErrors accepts the broken result. Extend the recognized interpolation syntax to cover numeric placeholders.
Useful? React with 👍 / 👎.
| - Respond with a JSON object that maps every item "id" to its translated string — every id, no other keys, no commentary. | ||
| - Every substring listed in an item's "preserve" array must appear in the translation exactly as written, byte for byte. Never translate, transliterate, or renumber them. | ||
| - Interpolation placeholders such as {name} stay exactly as written. | ||
| - The | character separates plural forms. Keep the same number of forms and translate each form. |
There was a problem hiding this comment.
Preserve locale-specific plural variant counts
When a pluralized source string is added or modified, forcing every locale to keep the English number of forms produces incorrect locale data: the existing Russian catalog deliberately uses three variants for many two-form English messages, while Chinese and Japanese commonly use one. The generated Russian message can therefore select the wrong grammar for some counts; instruct the translator to follow the target locale's Vue I18n plural forms instead of mirroring English.
AGENTS.md reference: AGENTS.md:L163-L163
Useful? React with 👍 / 👎.
| const protectedLiteralPatterns = [ | ||
| /<(?:Picture|Video|Audio) [A-Za-z0-9]>/g, | ||
| /\b\d+k\+\d+\b/g, | ||
| /(?<=['"“”「」])(?:match|max)(?=['"“”「」])/g | ||
| ] |
There was a problem hiding this comment.
When affected node-definition tooltips are regenerated, the protected-token list ignores exact prompt syntax already present in English, notably <bbox>...</bbox> and <img>...</img>. Those strings explicitly tell users to type these tags, but a model may translate or alter them and validation will accept the result, leaving localized instructions that generate invalid prompts. Add these opening and closing tags to the protected literals.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/i18n/protected-tokens.ts`:
- Around line 115-121: Update auditProtectedLiterals in
scripts/i18n/protected-tokens.ts at lines 115-121 to traverse array elements and
compare protected tokens for every string element, including unchanged source
arrays, while preserving existing skip-key behavior. Add a
placeholder/protected-literal validation test in
scripts/i18n/update-locales.test.ts at lines 271-288 covering an unchanged array
whose target corrupts a <Picture 10> or 17k+5 token.
In `@src/locales/it/main.json`:
- Line 4625: Update the Italian seekVideo translation from “Sposta video” to a
seek-specific label such as “Scorri il video”, preserving the meaning of moving
the playback position rather than moving the video itself.
In `@src/locales/zh-TW/main.json`:
- Line 4625: Update the seekVideo localization value to use a
seek-within-current-video label, such as `定位影片`, instead of wording that means
searching for a video.
In `@src/locales/zh/nodeDefs.json`:
- Around line 892-893: Update the Seedance 2.5 tooltip wording at
src/locales/zh/nodeDefs.json lines 892-893, 933-934, and 986-987, and
src/locales/zh-TW/nodeDefs.json lines 892-893, 933-934, and 986-987. Replace the
opening clause stating it uses or suits the latest model with wording that
clearly says Seedance 2.5 is the latest model, while preserving the existing
duration and output-format details.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: a7849e85-6a14-41a5-90ce-4c3df36dc63c
📒 Files selected for processing (32)
scripts/i18n/config.tsscripts/i18n/locale-tree.tsscripts/i18n/protected-tokens.tsscripts/i18n/translate.tsscripts/i18n/update-locales.test.tsscripts/i18n/update-locales.tssrc/locales/ar/main.jsonsrc/locales/ar/nodeDefs.jsonsrc/locales/es/main.jsonsrc/locales/es/nodeDefs.jsonsrc/locales/fa/main.jsonsrc/locales/fa/nodeDefs.jsonsrc/locales/fr/main.jsonsrc/locales/fr/nodeDefs.jsonsrc/locales/he/main.jsonsrc/locales/he/nodeDefs.jsonsrc/locales/it/main.jsonsrc/locales/it/nodeDefs.jsonsrc/locales/ja/main.jsonsrc/locales/ja/nodeDefs.jsonsrc/locales/ko/main.jsonsrc/locales/ko/nodeDefs.jsonsrc/locales/pt-BR/main.jsonsrc/locales/pt-BR/nodeDefs.jsonsrc/locales/ru/main.jsonsrc/locales/ru/nodeDefs.jsonsrc/locales/tr/main.jsonsrc/locales/tr/nodeDefs.jsonsrc/locales/zh-TW/main.jsonsrc/locales/zh-TW/nodeDefs.jsonsrc/locales/zh/main.jsonsrc/locales/zh/nodeDefs.json
| "play": "Riproduci", | ||
| "resolution": "{width} × {height}", | ||
| "retry": "Riprova", | ||
| "seekVideo": "Sposta video", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Translate seekVideo as a seek action.
"Sposta video" means “move video”. It does not describe moving the playback position. Use a seek-specific Italian label, such as "Scorri il video".
Proposed fix
- "seekVideo": "Sposta video",
+ "seekVideo": "Scorri il video",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "seekVideo": "Sposta video", | |
| "seekVideo": "Scorri il video", |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/locales/it/main.json` at line 4625, Update the Italian seekVideo
translation from “Sposta video” to a seek-specific label such as “Scorri il
video”, preserving the meaning of moving the playback position rather than
moving the video itself.
| "play": "播放", | ||
| "resolution": "{width} × {height}", | ||
| "retry": "重試", | ||
| "seekVideo": "搜尋影片", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Use a seek label, not a video-search label.
搜尋影片 means “search for a video”. This control moves within the current video. Use wording such as 定位影片.
Proposed fix
- "seekVideo": "搜尋影片",
+ "seekVideo": "定位影片",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "seekVideo": "搜尋影片", | |
| "seekVideo": "定位影片", |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/locales/zh-TW/main.json` at line 4625, Update the seekVideo localization
value to use a seek-within-current-video label, such as `定位影片`, instead of
wording that means searching for a video.
benjcooley
left a comment
There was a problem hiding this comment.
Solid replacement for lobe-i18n overall — rebuild-from-source, atomic validate-then-write, and the manifest-based invalidation are the right shape, and the tests cover the interesting paths. One finding I think should be addressed before this lands, plus a few smaller ones.
Main issue: the pipeline's headline claim ("validates that interpolation placeholders … survive translation") only holds for keys the manifest marks as added/modified. Seeding the manifest to the current English sources means every pre-existing placeholder corruption is grandfathered permanently and is invisible to pnpm locale:check. I scanned this branch's committed locales against en/: 148 keys across 12 locales have a placeholder set that differs from the English source. Details inline on protected-tokens.ts. it/main.json changingVersion — hand-fixed in this PR — is one instance of exactly that class; the other 148 were not found because nothing looks for them.
The fix is small and belongs here, while the baseline is being established.
| for (const [key, leaf] of collectLeaves(source)) { | ||
| if (typeof leaf.value !== 'string') continue | ||
| if (skipKeys.has(key)) continue | ||
| if (protectedTokens(leaf.value, false).length === 0) continue |
There was a problem hiding this comment.
[correctness] high — the standing audit is placeholder-blind, so 148 already-broken strings are grandfathered by the new manifest baseline.
auditProtectedLiterals is the only check that runs over unchanged keys, and it passes includeInterpolation: false, so it only looks at <Picture N> / 17k+5 / quoted match|max. Interpolation placeholders are validated in exactly two places, both of which skip pre-existing translations:
validateLocale's first loop — onlychanges.added+changes.modifiedtranslateLocaleItems— only strings actually sent to the model
Because the seeded manifest equals the current en/*.json, nothing is added/modified on the next run, and collectPendingLeaves sees string vs string so nothing is pending either. Net effect: pnpm locale:check reports "fully converged" while these remain, forever.
Scanning this branch's committed locales against en/ with the same interpolationPattern used here: 148 mismatches — zh 18, ja 16, zh-TW 15, ko 15, ru 14, fr 14, es 14, ar 14, pt-BR 10, tr 9, fa 8, he 1. These are live UI bugs, not cosmetic:
zh g.searchPlaceholder EN "Search {subject}..." TR "搜索占位符" (literally "search placeholder")
zh g.enabling EN "Enabling {id}" TR "启用中"
zh workspacePanel.inviteLimitReached
EN "You've reached the maximum of {count} members"
TR "您已达到最多 50 名成员的上限" (count hardcoded to 50)
zh workspacePanel.members.membersCount
EN "{count} of {maxSeats} members" TR "{count}/50 名成员"
zh g.itemsSelected EN "... | {count} item selected | ..." TR "已选择 {selectedCount} 项" (placeholder that is never passed → renders empty)
zh manager.failed EN "Failed" TR "失败 ({count})" (extra placeholder → renders empty)
zh assetBrowser.uploadModelDescription2
EN "Only links from {link} are supported at the moment"
TR "目前仅支持 <a href=…>https://civitai.com</a> 链接。" (raw HTML baked in where the source now uses a placeholder)
Suggested fix — make the placeholder check part of the standing audit and let it drive re-translation:
- Add a placeholder-parity check over all string leaves (source vs existing) in both
reportCheckandcollectPendingLeaves. - Treat a mismatch the same as
invalidated, sopnpm localerepairs them on the next run instead of preserving them.
That is one predicate reused in two places, and it turns FE-1499's "stale strings stay stale" guarantee into something the pipeline actually enforces. Without it, merging this permanently enshrines the 148.
There was a problem hiding this comment.
Concrete proof this is load-bearing, from the current head:
manager.changingVersion — EN "Changing version from {from} to {to}"
ok it: "Cambio versione da {from} a {to}" <- hand-fixed in this PR
BROKEN pt-BR: "Alterando versão de {from} para pt-BR"
Same key, same failure mode (the locale code substituted for {to}). it was found by eye and repaired here; pt-BR is untouched at head and pnpm locale:check reports the tree fully converged. That is the blind spot in one line — and it is the whole point of FE-1499.
For what it's worth, the Codex bot flagged the same thing independently ("Audit placeholders in unchanged locale entries", P2) and landed on the same pt-BR/manager.changingVersion example. Its sibling finding about {0} list interpolation is already fixed by 67716c9; this one is not.
| if (!isTranslatableLeaf(leaf.value)) continue | ||
| if ( | ||
| invalidated.has(key) || | ||
| !leafShapeMatches(leaf.value, getLeaf(existing, leaf.path)) |
There was a problem hiding this comment.
[correctness] high — companion to the protected-tokens.ts comment.
leafShapeMatches for two strings is typeof target === 'string', so a translation that dropped every {placeholder} still "matches shape" and is never marked pending. This is the second half of why the 148 corrupted strings are invisible: nothing invalidates them, so rebuildLocale copies them straight through.
A placeholder-set comparison here (source vs existing) would make them pending and get them repaired automatically.
| }) | ||
| return parseLocale(content, `${filename}@${hash}`) | ||
| } catch { | ||
| throw new Error( |
There was a problem hiding this comment.
[reliability] medium — this is an unrecoverable hard failure in a release-blocking workflow.
If git cat-file blob <hash> fails for any reason — a shallow/non-promisor clone, an object GC'd before it was ever reachable from a pushed commit, a rewritten branch, a transient failure of the lazy blob fetch — pnpm locale aborts entirely and there is no path forward except hand-editing .source-manifest.json. The catch {} also swallows a JSON parse failure of a perfectly readable blob and reports it as a history problem, which will send whoever hits it down the wrong trail.
Suggest degrading instead of aborting: warn, treat the baseline as "unknown" for that file (previous = source, i.e. no invalidation — backfill missing keys only), and let the run proceed. That keeps the failure mode no worse than today's lobe-i18n behavior rather than blocking the release. At minimum, distinguish the parse error from the fetch error.
| // must match what gets committed: normalize to the same serialization | ||
| // serializeLocale produces (collect-i18n omits the newline oxfmt adds) | ||
| const canonical = serializeLocale(source) | ||
| if (!check && raw !== canonical) writeFileSync(entryFile, canonical) |
There was a problem hiding this comment.
[reliability] medium — the manifest's correctness depends on an unenforced coupling between serializeLocale and oxfmt.
writeManifest hashes these files at the end of the run, but i18n-update-core.yaml runs pnpm locale && pnpm format — so oxfmt gets the last word on the bytes that are committed. I verified today they agree (JSON.stringify(…, null, 2) + '\n' is byte-identical to oxfmt's output for all four en/*.json, and the manifest hashes in this PR do match the committed blobs). But nothing enforces it. If oxfmt's JSON formatting ever changes, the recorded hash points at a blob that is written locally by hash-object -w and never pushed — and the next CI run hard-fails at readManifestSource with a misleading "run from a clone with full history" message.
Cheapest guard: add src/locales/**/*.json to .oxfmtrc.json ignorePatterns so this pipeline is the sole writer of those bytes. Alternatively re-read and re-verify after pnpm format, or drop && pnpm format from the workflow step.
| .map((item) => ` ${item.context}`) | ||
| .slice(0, 20) | ||
| .join('\n') | ||
| throw new Error( |
There was a problem hiding this comment.
[reliability] low SHOULD-FIX — one chunk that stays corrupted after 3 rounds throws, mapWithConcurrency's Promise.all rejects, run() aborts, and nothing is written. Every other locale's completed translation work is discarded and paid for again on the retry. With 13 locales × 4 files this is a real cost/wall-clock hazard on a large backfill.
Also worth checking choices[0].finish_reason === 'length' explicitly: with maxItemsPerRequest: 40 and no max_completion_tokens, a truncated response surfaces as a JSON parse error and burns all four attempts before anyone sees why.
| "lint:desktop": "pnpm --filter @comfyorg/desktop-ui run lint", | ||
| "locale": "lobe-i18n locale", | ||
| "locale": "tsx scripts/i18n/update-locales.ts", | ||
| "locale:check": "tsx scripts/i18n/update-locales.ts --check", |
There was a problem hiding this comment.
[quality] low SHOULD-FIX — locale:check is offline and cheap but isn't wired into any CI job, so drift is only caught during a release run where OPENAI_API_KEY is present and a failure blocks the release. Consider adding it to the standard PR checks; that is also where the placeholder audit from the protected-tokens.ts comment would earn its keep.
67716c9 to
440d24a
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 13
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/i18n-update-custom-nodes.yaml:
- Line 84: Update the copy command in the i18n update workflow to copy from
temp/diff/. instead of using the unmatched * glob, so an empty diff directory
becomes a successful no-op while existing locale files are still copied.
In `@scripts/i18n/translate.ts`:
- Around line 141-148: Update the retry handling in the OpenAI request flow to
honor a valid Retry-After response header for 429 statuses by waiting at least
the specified duration before continuing. Fall back to the existing fixed retry
delay when the header is absent or invalid, while preserving current behavior
for other retryable statuses.
In `@scripts/i18n/update-locales.test.ts`:
- Around line 178-186: Extend the tests for translateLocaleItems with an
empty-translation retry case: use a translator that returns whitespace on the
first attempt and a valid translation afterward, then assert the final
translated value and the retry note text indicating “empty translation.” Keep
the existing corrupted-token test unchanged and place the new case alongside the
retry/error coverage.
In `@scripts/i18n/update-locales.ts`:
- Around line 167-181: Extract the inline manifest validation into an
isSourceManifest(value: unknown): value is SourceManifest type guard, placed in
the appropriate lightweight leaf module. Update the surrounding logic to call
this predicate and return manifest directly after successful narrowing, removing
the trailing manifest as SourceManifest assertion while preserving all existing
validation checks.
- Around line 332-333: Validate manifest hashes before they reach
readManifestSource and git, accepting only hexadecimal object IDs of the
expected length; reject invalid entries such as option-like strings. Apply this
in the hash handling near loadManifest or before the readManifestSource call,
while preserving valid hash processing.
In `@src/locales/CONTRIBUTING.md`:
- Around line 53-59: Document the git-history prerequisite beside the OpenAI API
key prerequisite in the locale contributor instructions, noting that local runs
require a non-shallow clone. Update protected-token validation to compare
interpolation tokens for unchanged translations and traverse array elements
rather than skipping non-string leaves; update leafShapeMatches so
collectPendingLeaves reprocesses mismatched translations. Export the named
ReasoningEffort union from config and use it for
OpenAiTranslatorOptions.reasoningEffort in translate instead of string.
In `@src/locales/es/main.json`:
- Line 4909: Update the matchedModelCount translation so the singular form
“coincidencia” appears before the plural form “coincidencias,” preserving the
existing placeholders and separator.
In `@src/locales/fr/main.json`:
- Around line 3439-3440: Update the French translation for
openHuggingFaceRepoDesktop to make the new-tab fallback explicit by placing
“peut s’ouvrir dans un nouvel onglet” in parentheses, or remove that fragment if
it represents a separate action already covered by openHuggingFaceRepoNewTab.
- Around line 4897-4902: Update the French count labels in the locale entries
around disableAllCount, disableMatchingCount, enableAllCount, and
enableMatchingCount so singular and plural variants consistently appear in
singular-then-plural order, with {count} placed before the noun rather than
after it. Apply the same correction to the matchedModelCount entry noted in the
review.
In `@src/locales/it/main.json`:
- Around line 4900-4902: Update the Italian disableMatchingCount and
enableMatchingCount labels so the count appears before provider: use the
singular form for count 1 and the plural form for other counts, preserving the
existing disable/enable wording and plural agreement.
In `@src/locales/ko/main.json`:
- Line 4908: Update the loading translation value in the Korean locale to use
the object particle, changing it to “파트너 노드 접근을 불러오는 중” while leaving the
surrounding locale entries unchanged.
- Around line 3439-3440: Update the Korean labels openHuggingFaceRepoDesktop and
openHuggingFaceRepoNewTab to use 저장소 instead of 리포지토리, matching the existing
terminology for Hugging Face repositories.
In `@src/locales/pt-BR/main.json`:
- Around line 4897-4902: Update the Portuguese pluralized labels
disableAllCount, disableMatchingCount, enableAllCount, and enableMatchingCount
so {count} is expressed as a quantity of providers, using count-first phrasing
for both singular and plural variants; preserve the existing translation
meaning.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 3d429f5b-3469-45d4-ab39-711dff595ebf
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (42)
.github/workflows/i18n-update-core.yaml.github/workflows/i18n-update-custom-nodes.yaml.github/workflows/i18n-update-nodes.yaml.i18nrc.cjs.oxlintrc.jsoneslint.config.tspackage.jsonpnpm-workspace.yamlscripts/i18n/config.tsscripts/i18n/locale-tree.tsscripts/i18n/protected-tokens.tsscripts/i18n/translate.tsscripts/i18n/update-locales.test.tsscripts/i18n/update-locales.tssrc/locales/.source-manifest.jsonsrc/locales/CONTRIBUTING.mdsrc/locales/ar/main.jsonsrc/locales/ar/nodeDefs.jsonsrc/locales/es/main.jsonsrc/locales/es/nodeDefs.jsonsrc/locales/fa/main.jsonsrc/locales/fa/nodeDefs.jsonsrc/locales/fr/main.jsonsrc/locales/fr/nodeDefs.jsonsrc/locales/he/main.jsonsrc/locales/he/nodeDefs.jsonsrc/locales/it/main.jsonsrc/locales/it/nodeDefs.jsonsrc/locales/ja/main.jsonsrc/locales/ja/nodeDefs.jsonsrc/locales/ko/main.jsonsrc/locales/ko/nodeDefs.jsonsrc/locales/pt-BR/main.jsonsrc/locales/pt-BR/nodeDefs.jsonsrc/locales/ru/main.jsonsrc/locales/ru/nodeDefs.jsonsrc/locales/tr/main.jsonsrc/locales/tr/nodeDefs.jsonsrc/locales/zh-TW/main.jsonsrc/locales/zh-TW/nodeDefs.jsonsrc/locales/zh/main.jsonsrc/locales/zh/nodeDefs.json
💤 Files with no reviewable changes (4)
- pnpm-workspace.yaml
- .i18nrc.cjs
- .oxlintrc.json
- eslint.config.ts
| if ( | ||
| !manifest || | ||
| typeof manifest !== 'object' || | ||
| !('version' in manifest) || | ||
| manifest.version !== 1 || | ||
| !('files' in manifest) || | ||
| !manifest.files || | ||
| typeof manifest.files !== 'object' || | ||
| Array.isArray(manifest.files) || | ||
| !Object.values(manifest.files).every((hash) => typeof hash === 'string') | ||
| ) { | ||
| throw new Error(`${filename} has an invalid source manifest`) | ||
| } | ||
| return manifest as SourceManifest | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
Replace the trailing assertion with a type guard.
Line 180 asserts manifest as SourceManifest after the inline checks. Extract the checks into an isSourceManifest(value: unknown): value is SourceManifest predicate so the narrowing is carried by the type system.
As per path instructions, docs/guidance/typescript.md requires: "use precise types throughout: avoid any, as any, unnecessary assertions, and @ts-expect-error; narrow unknown values with type guards. Place reusable type guards in lightweight leaf modules to prevent circular dependencies."
🧰 Tools
🪛 ast-grep (0.45.1)
[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFileSync } from 'node:child_process'
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(detect-child-process-typescript)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@scripts/i18n/update-locales.ts` around lines 167 - 181, Extract the inline
manifest validation into an isSourceManifest(value: unknown): value is
SourceManifest type guard, placed in the appropriate lightweight leaf module.
Update the surrounding logic to call this predicate and return manifest directly
after successful narrowing, removing the trailing manifest as SourceManifest
assertion while preserving all existing validation checks.
Source: Path instructions
6d6a6fa to
6045f54
Compare
440d24a to
c40e2c6
Compare
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 13
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/i18n-update-custom-nodes.yaml:
- Line 84: Update the copy command in the i18n update workflow to copy from
temp/diff/. instead of using the unmatched * glob, so an empty diff directory
becomes a successful no-op while existing locale files are still copied.
In `@scripts/i18n/translate.ts`:
- Around line 141-148: Update the retry handling in the OpenAI request flow to
honor a valid Retry-After response header for 429 statuses by waiting at least
the specified duration before continuing. Fall back to the existing fixed retry
delay when the header is absent or invalid, while preserving current behavior
for other retryable statuses.
In `@scripts/i18n/update-locales.test.ts`:
- Around line 178-186: Extend the tests for translateLocaleItems with an
empty-translation retry case: use a translator that returns whitespace on the
first attempt and a valid translation afterward, then assert the final
translated value and the retry note text indicating “empty translation.” Keep
the existing corrupted-token test unchanged and place the new case alongside the
retry/error coverage.
In `@scripts/i18n/update-locales.ts`:
- Around line 167-181: Extract the inline manifest validation into an
isSourceManifest(value: unknown): value is SourceManifest type guard, placed in
the appropriate lightweight leaf module. Update the surrounding logic to call
this predicate and return manifest directly after successful narrowing, removing
the trailing manifest as SourceManifest assertion while preserving all existing
validation checks.
- Around line 332-333: Validate manifest hashes before they reach
readManifestSource and git, accepting only hexadecimal object IDs of the
expected length; reject invalid entries such as option-like strings. Apply this
in the hash handling near loadManifest or before the readManifestSource call,
while preserving valid hash processing.
In `@src/locales/CONTRIBUTING.md`:
- Around line 53-59: Document the git-history prerequisite beside the OpenAI API
key prerequisite in the locale contributor instructions, noting that local runs
require a non-shallow clone. Update protected-token validation to compare
interpolation tokens for unchanged translations and traverse array elements
rather than skipping non-string leaves; update leafShapeMatches so
collectPendingLeaves reprocesses mismatched translations. Export the named
ReasoningEffort union from config and use it for
OpenAiTranslatorOptions.reasoningEffort in translate instead of string.
In `@src/locales/es/main.json`:
- Line 4909: Update the matchedModelCount translation so the singular form
“coincidencia” appears before the plural form “coincidencias,” preserving the
existing placeholders and separator.
In `@src/locales/fr/main.json`:
- Around line 3439-3440: Update the French translation for
openHuggingFaceRepoDesktop to make the new-tab fallback explicit by placing
“peut s’ouvrir dans un nouvel onglet” in parentheses, or remove that fragment if
it represents a separate action already covered by openHuggingFaceRepoNewTab.
- Around line 4897-4902: Update the French count labels in the locale entries
around disableAllCount, disableMatchingCount, enableAllCount, and
enableMatchingCount so singular and plural variants consistently appear in
singular-then-plural order, with {count} placed before the noun rather than
after it. Apply the same correction to the matchedModelCount entry noted in the
review.
In `@src/locales/it/main.json`:
- Around line 4900-4902: Update the Italian disableMatchingCount and
enableMatchingCount labels so the count appears before provider: use the
singular form for count 1 and the plural form for other counts, preserving the
existing disable/enable wording and plural agreement.
In `@src/locales/ko/main.json`:
- Line 4908: Update the loading translation value in the Korean locale to use
the object particle, changing it to “파트너 노드 접근을 불러오는 중” while leaving the
surrounding locale entries unchanged.
- Around line 3439-3440: Update the Korean labels openHuggingFaceRepoDesktop and
openHuggingFaceRepoNewTab to use 저장소 instead of 리포지토리, matching the existing
terminology for Hugging Face repositories.
In `@src/locales/pt-BR/main.json`:
- Around line 4897-4902: Update the Portuguese pluralized labels
disableAllCount, disableMatchingCount, enableAllCount, and enableMatchingCount
so {count} is expressed as a quantity of providers, using count-first phrasing
for both singular and plural variants; preserve the existing translation
meaning.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 3d429f5b-3469-45d4-ab39-711dff595ebf
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (42)
.github/workflows/i18n-update-core.yaml.github/workflows/i18n-update-custom-nodes.yaml.github/workflows/i18n-update-nodes.yaml.i18nrc.cjs.oxlintrc.jsoneslint.config.tspackage.jsonpnpm-workspace.yamlscripts/i18n/config.tsscripts/i18n/locale-tree.tsscripts/i18n/protected-tokens.tsscripts/i18n/translate.tsscripts/i18n/update-locales.test.tsscripts/i18n/update-locales.tssrc/locales/.source-manifest.jsonsrc/locales/CONTRIBUTING.mdsrc/locales/ar/main.jsonsrc/locales/ar/nodeDefs.jsonsrc/locales/es/main.jsonsrc/locales/es/nodeDefs.jsonsrc/locales/fa/main.jsonsrc/locales/fa/nodeDefs.jsonsrc/locales/fr/main.jsonsrc/locales/fr/nodeDefs.jsonsrc/locales/he/main.jsonsrc/locales/he/nodeDefs.jsonsrc/locales/it/main.jsonsrc/locales/it/nodeDefs.jsonsrc/locales/ja/main.jsonsrc/locales/ja/nodeDefs.jsonsrc/locales/ko/main.jsonsrc/locales/ko/nodeDefs.jsonsrc/locales/pt-BR/main.jsonsrc/locales/pt-BR/nodeDefs.jsonsrc/locales/ru/main.jsonsrc/locales/ru/nodeDefs.jsonsrc/locales/tr/main.jsonsrc/locales/tr/nodeDefs.jsonsrc/locales/zh-TW/main.jsonsrc/locales/zh-TW/nodeDefs.jsonsrc/locales/zh/main.jsonsrc/locales/zh/nodeDefs.json
💤 Files with no reviewable changes (4)
- pnpm-workspace.yaml
- .i18nrc.cjs
- .oxlintrc.json
- eslint.config.ts
🛑 Comments failed to post (8)
.github/workflows/i18n-update-custom-nodes.yaml (1)
84-84: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Handle an empty diff directory before copying.
At Line 84, the
*glob has no match when no locale additions exist. The shell passes the literal path tocp, so a valid no-op run fails.Use
temp/diff/.or an explicit empty-directory guard.Proposed fix
- cp -rf temp/diff/* "$LOCALE_DIR" + cp -rf temp/diff/. "$LOCALE_DIR"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.cp -rf temp/diff/. "$LOCALE_DIR"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/i18n-update-custom-nodes.yaml at line 84, Update the copy command in the i18n update workflow to copy from temp/diff/. instead of using the unmatched * glob, so an empty diff directory becomes a successful no-op while existing locale files are still copied.src/locales/es/main.json (1)
4909-4909: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Put the singular form first.
Line 4909 uses
coincidencias | coincidencia. The singular and plural forms are reversed. Use"{matched} de {total} coincidencia | {matched} de {total} coincidencias"so the count renders the correct noun form.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locales/es/main.json` at line 4909, Update the matchedModelCount translation so the singular form “coincidencia” appears before the plural form “coincidencias,” preserving the existing placeholders and separator.src/locales/fr/main.json (2)
3439-3440: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Make the desktop fallback explicit.
openHuggingFaceRepoDesktopjoins an action label with the fragmentpeut s’ouvrir dans un nouvel onglet. If the new-tab behavior is a fallback, use parentheses. If it is a separate action, remove it becauseopenHuggingFaceRepoNewTabalready covers that action.Proposed wording
- "openHuggingFaceRepoDesktop": "Ouvrir le dépôt Hugging Face de {model} dans l’application de bureau ; peut s’ouvrir dans un nouvel onglet", + "openHuggingFaceRepoDesktop": "Ouvrir le dépôt Hugging Face de {model} dans l’application de bureau (peut s’ouvrir dans un nouvel onglet)",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements."openHuggingFaceRepoDesktop": "Ouvrir le dépôt Hugging Face de {model} dans l’application de bureau (peut s’ouvrir dans un nouvel onglet)", "openHuggingFaceRepoNewTab": "Ouvrir le dépôt Hugging Face de {model} dans un nouvel onglet",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locales/fr/main.json` around lines 3439 - 3440, Update the French translation for openHuggingFaceRepoDesktop to make the new-tab fallback explicit by placing “peut s’ouvrir dans un nouvel onglet” in parentheses, or remove that fragment if it represents a separate action already covered by openHuggingFaceRepoNewTab.
4897-4902: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Fix the French count and plural forms.
The singular count labels place
{count}after the noun, which reads as an identifier.matchedModelCountalso reverses the singular and plural variants. Put the count before the noun and keep the singular form before the plural form.Proposed wording
- "disableAllCount": "Désactiver le fournisseur {count} | Désactiver les {count} fournisseurs", + "disableAllCount": "Désactiver {count} fournisseur | Désactiver {count} fournisseurs", - "disableMatchingCount": "Désactiver le fournisseur correspondant {count} | Désactiver les fournisseurs correspondants {count}", + "disableMatchingCount": "Désactiver {count} fournisseur correspondant | Désactiver {count} fournisseurs correspondants", - "enableAllCount": "Activer le fournisseur {count} | Activer les {count} fournisseurs", + "enableAllCount": "Activer {count} fournisseur | Activer {count} fournisseurs", - "enableMatchingCount": "Activer le fournisseur correspondant {count} | Activer les fournisseurs correspondants {count}", + "enableMatchingCount": "Activer {count} fournisseur correspondant | Activer {count} fournisseurs correspondants", - "matchedModelCount": "{matched} correspondances sur {total} | {matched} correspondance sur {total}", + "matchedModelCount": "{matched} correspondance sur {total} | {matched} correspondances sur {total}",Also applies to: 4909-4909
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locales/fr/main.json` around lines 4897 - 4902, Update the French count labels in the locale entries around disableAllCount, disableMatchingCount, enableAllCount, and enableMatchingCount so singular and plural variants consistently appear in singular-then-plural order, with {count} placed before the noun rather than after it. Apply the same correction to the matchedModelCount entry noted in the review.src/locales/it/main.json (1)
4900-4902: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Move
{count}beforeproviderin the Italian matching-count labels.When
{count}is1, the current strings renderDisabilita il provider corrispondente 1andAbilita il provider corrispondente 1. Use the singular and plural forms below.Proposed fix
- "disableMatchingCount": "Disabilita il provider corrispondente {count} | Disabilita i {count} provider corrispondenti", + "disableMatchingCount": "Disabilita {count} provider corrispondente | Disabilita {count} provider corrispondenti", - "enableMatchingCount": "Abilita il provider corrispondente {count} | Abilita i {count} provider corrispondenti", + "enableMatchingCount": "Abilita {count} provider corrispondente | Abilita {count} provider corrispondenti",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements."disableMatchingCount": "Disabilita {count} provider corrispondente | Disabilita {count} provider corrispondenti", "enableAllCount": "Abilita tutti i {count} provider | Abilita tutti i {count} provider", "enableMatchingCount": "Abilita {count} provider corrispondente | Abilita {count} provider corrispondenti",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locales/it/main.json` around lines 4900 - 4902, Update the Italian disableMatchingCount and enableMatchingCount labels so the count appears before provider: use the singular form for count 1 and the plural form for other counts, preserving the existing disable/enable wording and plural agreement.src/locales/ko/main.json (2)
3439-3440: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Use one Korean term for the Hugging Face repository.
Line 3438 uses
저장소, but these new labels use리포지토리for the same concept. Use저장소in both new labels to keep the missing-model actions consistent.Proposed wording
- "openHuggingFaceRepoDesktop": "데스크톱 앱에서 {model}의 Hugging Face 리포지토리 열기(새 탭에서 열릴 수 있음)", - "openHuggingFaceRepoNewTab": "새 탭에서 {model}의 Hugging Face 리포지토리 열기", + "openHuggingFaceRepoDesktop": "데스크톱 앱에서 {model}의 Hugging Face 저장소 열기(새 탭에서 열릴 수 있음)", + "openHuggingFaceRepoNewTab": "새 탭에서 {model}의 Hugging Face 저장소 열기",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements."openHuggingFaceRepoDesktop": "데스크톱 앱에서 {model}의 Hugging Face 저장소 열기(새 탭에서 열릴 수 있음)", "openHuggingFaceRepoNewTab": "새 탭에서 {model}의 Hugging Face 저장소 열기",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locales/ko/main.json` around lines 3439 - 3440, Update the Korean labels openHuggingFaceRepoDesktop and openHuggingFaceRepoNewTab to use 저장소 instead of 리포지토리, matching the existing terminology for Hugging Face repositories.
4908-4908: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add the object particle to the loading label.
loadErroruses파트너 노드 접근을, butloadingomits을. Use파트너 노드 접근을 불러오는 중for natural Korean.Proposed wording
- "loading": "파트너 노드 접근 불러오는 중", + "loading": "파트너 노드 접근을 불러오는 중",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements."loading": "파트너 노드 접근을 불러오는 중",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locales/ko/main.json` at line 4908, Update the loading translation value in the Korean locale to use the object particle, changing it to “파트너 노드 접근을 불러오는 중” while leaving the surrounding locale entries unchanged.src/locales/pt-BR/main.json (1)
4897-4902: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Render
{count}as a quantity, not a provider identifier.These labels can render text such as
Desativar o provedor 3. The keys describe bulk provider counts, so the text must describe three providers.Use count-first Portuguese phrasing for the disable and enable variants.
Proposed fix
- "disableAllCount": "Desativar o provedor {count} | Desativar todos os {count} provedores", + "disableAllCount": "Desativar {count} provedor | Desativar todos os {count} provedores", - "disableMatchingCount": "Desativar o provedor correspondente {count} | Desativar os {count} provedores correspondentes", + "disableMatchingCount": "Desativar {count} provedor correspondente | Desativar {count} provedores correspondentes", - "enableAllCount": "Ativar o provedor {count} | Ativar todos os {count} provedores", + "enableAllCount": "Ativar {count} provedor | Ativar todos os {count} provedores", - "enableMatchingCount": "Ativar o provedor correspondente {count} | Ativar os {count} provedores correspondentes", + "enableMatchingCount": "Ativar {count} provedor correspondente | Ativar {count} provedores correspondentes",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements."disableAllCount": "Desativar {count} provedor | Desativar todos os {count} provedores", "disableAllMessage": "Todos os provedores serão desativados. Os nós de parceiros ficarão indisponíveis enquanto o acesso estiver restrito.", "disableAllTitle": "Desabilitar todos os provedores?", "disableMatchingCount": "Desativar {count} provedor correspondente | Desativar {count} provedores correspondentes", "enableAllCount": "Ativar {count} provedor | Ativar todos os {count} provedores", "enableMatchingCount": "Ativar {count} provedor correspondente | Ativar {count} provedores correspondentes",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/locales/pt-BR/main.json` around lines 4897 - 4902, Update the Portuguese pluralized labels disableAllCount, disableMatchingCount, enableAllCount, and enableMatchingCount so {count} is expressed as a quantity of providers, using count-first phrasing for both singular and plural variants; preserve the existing translation meaning.
benjcooley
left a comment
There was a problem hiding this comment.
Re-reviewed at c40e2c67. No pipeline code changed — all six files under scripts/i18n/ are byte-identical to 67716c9e, so all six findings from my previous review stand unaddressed. What changed is structural: the branch was squashed and rebased onto newer main, and the base was retargeted to bl/fix-i18n-locale-data (#15137).
The split is a good call — the pipeline is much easier to review without 26 locale JSON files in the diff. Two things to flag though.
1. #15137 does not repair this class of corruption. I re-ran the placeholder audit across both heads. #15137 fixed zero of the 148 mismatches I reported. pt-BR/manager.changingVersion is still "Alterando versao de {from} para pt-BR" at this head — the same key the author hand-fixed for it, in a PR titled "repair stale and malformed locale data." If #15137 is meant to be the data-repair half of this work, this class is its most obvious gap.
2. The count went up during review — 148 to 161. Every locale gained one, including it, which was previously clean. Details inline. That the number moved in the wrong direction while the PR sat in review, by exactly the mechanism the pipeline is supposed to prevent, is the argument for fixing the audit here rather than in a follow-up.
Manifest integrity re-verified at this head: all four recorded hashes still match the committed en/*.json blobs.
| for (const [key, leaf] of collectLeaves(source)) { | ||
| if (typeof leaf.value !== 'string') continue | ||
| if (skipKeys.has(key)) continue | ||
| if (protectedTokens(leaf.value, false).length === 0) continue |
There was a problem hiding this comment.
[correctness] high — still unaddressed, and the drift got worse during review: 148 to 161 placeholder mismatches.
The rebase pulled in a newly-broken key, corrupted in all 13 locales at once:
EN rightSidePanel.missingModels.gatedModelsHint
"{count} model is gated. To download it, sign in to Hugging Face and accept
its license agreement. | {count} models are gated. To download them, ..."
it "Alcuni modelli sono protetti. Per scaricarli, accedi a Hugging Face e ..."
fr "Certains modeles sont restreints. Pour les telecharger, connectez-vous ..."
zh "部分模型为受限模型。要下载这些模型,请登录 Hugging Face 并同意模型许可协议。"
ja "一部のモデルは制限されています。ダウンロードするには..."
The English was changed to a two-form plural carrying {count}; every translation is a single form with no {count} at all, so none of them can render the number. This is precisely the FE-1499 failure mode — English changed, translations stayed stale.
Why this PR will not catch it: the manifest at this head records the current en/main.json (b417a114), which already contains the {count} version. So on the next run gatedModelsHint is neither added nor modified, so it is not invalidated; leafShapeMatches sees string vs string, so it is not pending; and this line's includeInterpolation: false means the standing audit never looks at {count}. pnpm locale:check will report the tree fully converged.
Note what happened here: the corruption landed on main while this PR was in review, and merging as-is freezes it into the baseline permanently. That is the case for fixing the audit in this PR rather than deferring — every day the baseline is seeded later, it grandfathers more. Same suggested fix as before: compare placeholder sets over all string leaves and treat a mismatch as invalidated so pnpm locale repairs them.
(Also worth deciding deliberately: 161 of these repaired at once is a meaningful translation spend. Gating the repair behind a flag, or landing it as a one-time backfill, are both reasonable — but silently grandfathering them is not.)
christian-byrne
left a comment
There was a problem hiding this comment.
Reviewed the whole pipeline end to end, plus the history of what it replaces. Recording the conclusion up front: I think this should land.
I came into this worried that replacing @lobehub/i18n-cli trades a working, quietly-maintained dependency for a maintenance burden. I dug into whether that is true and it mostly is not, so I want the reasoning on the record rather than sitting in my head:
- The bug is structural, not a regression. lobe computes
just-diff(target, entry)and keeps only theaddandremoveops; thereplaceop is computed and discarded. A key-structure equality check upstream of that means a value-only edit skips the file entirely — no request, no write, no log line. The same filter is in 1.20.1, the version adopted in #1751 in Dec 2024. It has never worked. - Replaying the git history of the English locale files: 644 English strings have been edited in place and never retranslated — 351 in
nodeDefs.json, 293 inmain.json, earliest 2024-12. Still live onmaintoday: theSamplerER_SDEetatooltip describes a limitation that was deleted from the English, in all 13 locales. - lobe is 5,800 LOC but the path
pnpm localeexecutes is ~815 of them; markdown translation, the TUI, the config wizard and the lint command are dead weight for us. Upstream shipped three releases in the last fourteen months. And its package exports exactly one symbol,defineConfig— the diff, chunker and translator are bundled into the CLI and unreachable — so "keep the engine, own the invalidation" is only possible by mutating files on disk and shelling out. That constraint is why #15024 was 600–700 lines, and it is the strongest argument for this PR. - Splitting the data repairs into #15137 and landing them first was the right call. Seeding the manifest before the repairs would have declared all 644 stale strings fresh and frozen them permanently. Worth saying out loud.
Everything below is diff-level. Nothing here is architectural and nothing suggests restarting — I would like to iterate on this branch rather than reopen the approach.
Blocking
translate.tsL143 — thefinish_reason: "length"retry replays a byte-identical request four times, then fails the run.update-locales.tsL369 + the CI workflows —pnpm locale:checksilently skips changed-string detection whenever the recorded blob is unreachable, and the twoci-lint-format*workflows check out at depth 1. The gate goes quiet in precisely the case it exists to catch.protected-tokens.tsL30 — plural-form counts are never validated; 39 strings inmain.jsonare exposed to a silently dropped form.protected-tokens.tsL68 — hand-authored translations are silently regenerated on placeholder drift even when English never changed, with no per-leaf record of why.config.tsL49 — please pingpt-4.1here and swap the model in a separate PR.translate.tsL150 — use theopenaiSDK rather than hand-rolled retry/backoff/timeout.
Two things not anchored to a line in this diff
.github/workflows/ci-lint-format.yamlandci-lint-format-queue.yamlneedfetch-depth: 0+filter: blob:none, matching what this PR already did to the three i18n workflows. Without it, finding 2 stands regardless of what changes inupdate-locales.ts.- Please run
i18n-update-custom-nodes.yamlonce end to end against a real node pack before merging. Its copy path was wrong until #15137 fixed it, which means it has been failing quietly for some time, and this PR also changes its checkout. That workflow opens PRs against other people's repositories, so it is the one place a mistake here is visible outside our own.
Worth considering, not blocking
- Port rename detection (
locale-tree.tsL101). A deleted leaf and an added leaf with identical source content are the same string moved; carrying the translation over is ~15 lines and node renames innodeDefs.jsonare routine. - We are giving up
lobe-i18n lint's ELD language detection. We never wired it up, so it is an unclaimed option rather than a working feature — but it catches exactly the "zh-TW file contains Simplified characters" class we have already shipped once.eldis a standalone package if we want it back later. - For the record on due diligence:
lingo.dev(Apache-2.0, actively maintained, BYO key) solves this problem with a lockfile of per-key source hashes — the same design this PR arrived at independently, which I take as a good sign. I am not suggesting we switch; its migration cost is not lower than finishing this, and our escaping contract is ours either way. But it is the question that comes back in six months if nobody can say we looked.
|
|
||
| let lastError = new Error('translation request was not attempted') | ||
| let serverRetryDelayMs = 0 | ||
| for (let attempt = 0; attempt <= retryDelaysMs.length; attempt++) { |
There was a problem hiding this comment.
Blocking — the truncation retry replays the identical request.
body is built once at L128, outside this loop. When finish_reason === "length" (L183) the handler sets lastError and continues, which re-POSTs the same model, the same chunk and the same params. Nothing between attempts changes the input, so a chunk that overflows the output window overflows it again on all four attempts, and the run then dies with an error telling a human to lower maxItemsPerRequest.
Truncation is the one failure in this loop that is a property of the request rather than of the server, so it needs different handling from the 429/5xx path: split the chunk in half and translate the halves, or drop maxItemsPerRequest for the retry.
There was a problem hiding this comment.
Good catch. I have this fixed in the pending follow-up diff: finish_reason: "length" now bisects a multi-item batch and translates the two halves, recursively if needed, instead of replaying the identical request. A focused test verifies that both follow-up request bodies are smaller and that their responses are combined. A truncated single-item batch fails immediately because it cannot be split further. This is local and validated, but not pushed yet.
| : undefined | ||
| if (finishReason === 'length') { | ||
| lastError = new Error( | ||
| 'OpenAI response was truncated (finish_reason "length"); lower maxItemsPerRequest or maxSourceCharsPerRequest' |
There was a problem hiding this comment.
This message asks a human to change maxItemsPerRequest / maxSourceCharsPerRequest, but nothing in the code path does that automatically and the retry that follows does not change the request at all. Once the split-on-truncation fix is in, this should become an internal detail that never reaches an operator.
There was a problem hiding this comment.
Handled by the same pending split-on-truncation change. Multi-item truncation is now recovered internally and no longer reaches this operator message. The message remains only for an irreducible single-item batch, where lowering the configured source/request bound is still the available recovery. Local and validated, not pushed yet.
| const fetchFn = options.fetchFn ?? fetch | ||
| const timeoutMs = options.requestTimeoutMs ?? defaultRequestTimeoutMs | ||
| return async (locale, items) => { | ||
| const body = JSON.stringify({ |
There was a problem hiding this comment.
No max_completion_tokens is set, so the output bound is whatever the model defaults to — and output truncation is precisely the failure this loop is trying to survive. Worth setting it explicitly so the chunk-size math has a number to be derived from instead of an implicit one.
There was a problem hiding this comment.
I am leaving max_completion_tokens unset for now. An arbitrary explicit cap would introduce another source of truncation without making the character heuristic token-aware; the recursive split now provides the actual safety net. If we add a cap later, it should come from a measured token/cost policy rather than a guessed constant.
| return async (locale, items) => { | ||
| const body = JSON.stringify({ | ||
| model: options.model, | ||
| reasoning_effort: options.reasoningEffort, |
There was a problem hiding this comment.
ReasoningEffort in config.ts admits 'none' | 'xhigh' | 'max', which the Chat Completions API does not accept. The type is wider than the wire contract, so a config typo becomes a 400 at minute 30 of a 13-locale run rather than a compile error. Narrow the union to the values the endpoint actually takes.
There was a problem hiding this comment.
I have removed the local ReasoningEffort union in the pending follow-up diff. TranslationPipelineConfig.reasoningEffort is now derived as NonNullable<OpenAI.ChatCompletionCreateParams['reasoning_effort']>, so the request configuration tracks the SDK wire type directly. The current SDK and configured GPT-5.6 Terra model support the values this PR uses. Local and validated, not pushed yet.
| } | ||
| try { | ||
| const response = await fetchFn( | ||
| 'https://api.openai.com/v1/chat/completions', |
There was a problem hiding this comment.
Consider using the openai SDK instead of hand-rolled transport.
Between here and L207 the PR owns: retry policy, backoff schedule, Retry-After parsing and clamping, request timeout, HTTP error classification, and response-shape narrowing. That is roughly 100 lines of code whose only job is to be the same as the SDK, and it is the part of this PR that will rot on someone else's schedule rather than ours.
This is the single largest reduction available in what we newly own, and it does not touch any of the design that makes this PR worth landing.
There was a problem hiding this comment.
Addressed on the current PR head by fbde245: the transport now uses the official openai SDK, which owns network retry policy, backoff and Retry-After handling, timeout behavior, HTTP classification, and response typing. The pipeline retains only domain-level handling for truncated or malformed translation content.
| return parseLocale(readFileSync(filename, 'utf8'), filename) | ||
| } | ||
|
|
||
| export function serializeLocale(locale: LocaleObject): string { |
There was a problem hiding this comment.
Now that .oxfmtrc.json excludes src/locales/**/*.json, this function is the only thing defining the on-disk format, and nothing enforces it on a hand-edited file. A contributor who reformats a locale file in an editor produces a diff the pipeline will silently rewrite on its next run. Worth a line in CONTRIBUTING.md.
There was a problem hiding this comment.
Fixed in 45d9f9d. src/locales/CONTRIBUTING.md now documents the canonical locale JSON format (recursively sorted keys, two-space indentation, and a trailing newline), explains that oxfmt intentionally ignores these files, and warns that a successful locale run normalizes formatting while preserving unchanged translation values.
| export const translationPipelineConfig: TranslationPipelineConfig = { | ||
| entry: 'src/locales/en', | ||
| output: 'src/locales', | ||
| model: 'gpt-5.6-terra', |
There was a problem hiding this comment.
Please pin gpt-4.1 in this PR and swap the model separately.
This changes the translation engine and the framework in one commit. If output quality moves — across 13 locales, including four with hand-written guidance we cannot easily spot-check — there is no way to attribute it, and the natural response would be to distrust the migration.
The follow-up is a one-line diff whose review is about translation quality, which is a completely different conversation from this one and deserves its own.
There was a problem hiding this comment.
Keeping gpt-5.6-terra by author decision. I agree that model changes affect output attribution, but the model selection is intentional and already landed with #15062; reverting it in this follow-up would add another behavior change and unwind the reasoning-aware request configuration. No change here.
| output: 'src/locales', | ||
| model: 'gpt-5.6-terra', | ||
| reasoningEffort: 'high', | ||
| maxItemsPerRequest: 40, |
There was a problem hiding this comment.
These two numbers are the entire chunking policy and they are currently unexplained constants. Once the truncation path re-chunks (see translate.ts L143), say in a comment that they are a starting heuristic with a safety net rather than a measured bound — otherwise the next person to see a truncation will tune these instead of trusting the split.
There was a problem hiding this comment.
Fixed in 9f04e9b. chunkItems now states that character count is only the initial batching heuristic and that truncated responses are recursively split before the run fails, so the constants are not presented as measured bounds.
| 'latent' is the short form of 'latent space'. | ||
| 'mask' is in the context of image processing.` | ||
|
|
||
| const chineseSimplifiedGuidance = `Use ONLY Simplified Chinese characters (简体中文). Common examples: 节点 (not 節點), 画布 (not 畫布), 图像 (not 圖像), 选择 (not 選擇), 减小 (not 減小). NEVER mix Simplified and Traditional Chinese characters.` |
There was a problem hiding this comment.
Carrying over the .i18nrc.cjs reference prompt verbatim is the right call and I checked it line by line — glossary terms, Simplified/Traditional rules, Persian numerals, Hebrew RTL and term glossary all survive.
One thing lost in the move: the old prompt framed the target as "BCP 47" and this one passes an English language name. That is probably better for the model, but zh vs zh-TW now depends entirely on the name string and the guidance text rather than on a tag the model can reason about. Worth a test that the two Chinese locales stay disjoint in script — it is the failure mode we have already shipped once (#5013).
There was a problem hiding this comment.
Fixed in 45d9f9d. The model prompt now identifies the targets as zh-Hans and zh-Hant-TW in addition to their English names. The pipeline also rejects the known Simplified/Traditional cross-script terms from #5013 before persisting output, with focused tests for both locales; the full committed locale corpus passes the new audit.
There was a problem hiding this comment.
On further review, I think the dedicated script validator is excessive and I no longer think this comment warrants a production guard. The old pipeline already carried explicit Simplified/Traditional instructions; the migration materially improves reliability by moving from gpt-4.1 to gpt-5.6-terra with high reasoning, naming the active target as Simplified Chinese or Traditional Chinese (Taiwan), and attaching only that locale-specific guidance instead of putting both Chinese variants into one global reference block. Given those changes, a hardcoded vocabulary list adds maintenance cost and incomplete/false-positive validation without meaningfully reducing practical risk. Treating this as no-fix.
| protected literals (e.g. `<Picture N>`, `17k+5`) survive translation exactly. | ||
| Existing translations whose placeholders no longer match the English source are | ||
| re-queued for translation, so corrupted strings heal on the next run. Runs that | ||
| would delete an implausibly large share of a file's keys abort without writing |
There was a problem hiding this comment.
"the pipeline is the sole writer of those bytes" sits in the same document that invites contributors to open manual translation PRs, and the two statements are in tension.
What the code actually does is worth stating here explicitly, because it is good news and nobody will discover it by reading rebuildLocale: a hand-authored translation is preserved verbatim unless the English source changed, the value shape changed, or its placeholders drifted from the English. That is a stronger guarantee than lobe gave, where hand edits survived only as a side effect of key-diffing.
The third condition is the one to warn people about — see the note on protected-tokens.ts L68.
There was a problem hiding this comment.
Fixed in 45d9f9d. The contributor guide now says that unchanged hand-authored translation values are preserved and distinguishes that from canonical JSON formatting. It also reflects the hardened behavior added in this follow-up: placeholder or protected-literal drift on an unchanged source blocks checks and generation with the affected path instead of silently overwriting the manual translation.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
- Widen quoted match/max protection to locale-typical quote styles - Drop the backslash lookbehind that exempted real placeholders; flag introduced plural separators and linked messages; audit arrays, type changes, and blank translations - Preserve keys named __proto__ in rebuilt locales - Persist completed entry files and advance their manifest entries when another file fails; stop dispatching translation requests after a fatal error - Prune locale files whose English source file was removed - Fail locale:check on protected-token violations beyond the manifest's transitional knownViolations baseline, which the first successful locale run heals and drops - Give locale:check callers blobless full history so changed-string detection works on PRs; plumb an allow_prune dispatch input; move prune thresholds into config
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/i18n-update-core.yaml:
- Around line 58-63: Separate the translation and formatting commands in the
workflow so their outcomes are tracked independently. Update the final
failure-reporting step to distinguish a failed pnpm locale command from a failed
pnpm format command, while preserving continue-on-error behavior for committing
completed translation files.
- Around line 7-11: Update the workflow’s manual-dispatch branch handling to use
`${{ github.head_ref || github.ref_name }}` for fetch, checkout, and push
operations. Add validation that rejects tag refs before any push occurs, while
preserving the existing branch behavior for pull-request runs.
In `@scripts/i18n/update-locales.ts`:
- Line 449: Require the --allow-prune option before deleting files identified by
orphanedOutputFiles in the pruning flows around the orphanedOutputFiles call and
its corresponding deletion path. Ensure orphaned locale files are never removed
without explicit permission, including entries absent from src/locales/en, and
add coverage for a missing English entry file.
In `@src/locales/CONTRIBUTING.md`:
- Around line 122-125: The documentation wording should reflect run-level
behavior: replace “abort that file without writing” with language stating that
an unsafe prune aborts the entire generation run before any locale files are
written. Keep the existing guidance about using --allow-prune only after
verifying complete English sources.
Apply the same fix in `@src/locales/CONTRIBUTING.md` around lines 131 - 133.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: ad9f41d6-d745-47fa-86ce-3a752477f50f
📒 Files selected for processing (11)
.github/workflows/ci-lint-format-queue.yaml.github/workflows/ci-lint-format.yaml.github/workflows/i18n-update-core.yamlscripts/i18n/config.tsscripts/i18n/locale-tree.tsscripts/i18n/protected-tokens.tsscripts/i18n/translate.tsscripts/i18n/update-locales.test.tsscripts/i18n/update-locales.tssrc/locales/.source-manifest.jsonsrc/locales/CONTRIBUTING.md
| inputs: | ||
| allow_prune: | ||
| description: 'Confirm deletions larger than the prune threshold' | ||
| type: boolean | ||
| default: false |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
file=.github/workflows/i18n-update-core.yaml
rg -n -C2 \
'workflow_dispatch|allow_prune|github\.head_ref|github\.ref_name|git (fetch|checkout|push)' \
"$file"
if rg -n 'git (fetch|checkout|push).*github\.head_ref' "$file"; then
echo "Manual dispatch still uses the pull-request-only head_ref." >&2
exit 1
fiRepository: Comfy-Org/ComfyUI_frontend
Length of output: 1937
🏁 Script executed:
sed -n '1,120p' .github/workflows/i18n-update-core.yamlRepository: Comfy-Org/ComfyUI_frontend
Length of output: 3706
🌐 Web query:
GitHub Actions workflow_dispatch github.head_ref github.ref_name manual dispatch branch tag documentation
💡 Result:
When manually triggering a workflow via the workflow_dispatch event, you can specify a target branch or tag using the GitHub UI, GitHub CLI, or REST API [1][2]. The following clarifies the behavior of relevant GitHub context properties in this context: 1. github.ref_name: This context property correctly identifies the branch or tag name that was selected when the workflow was manually triggered [3][4]. It is the recommended property to use for referencing the current branch or tag in workflow_dispatch runs [4]. 2. github.head_ref: This property is only defined for pull_request and pull_request_target events [5][6][7]. It will be empty (undefined) for workflow_dispatch runs [4]. If you write a workflow that handles both pull_request and workflow_dispatch events, you should avoid relying on github.head_ref without providing a fallback (e.g., using ${{ github.head_ref || github.ref_name }}) to prevent errors [8]. In summary, for manual dispatches, github.ref_name provides the desired branch/tag context, while github.head_ref is not applicable [4][7].
Citations:
- 1: https://docs.github.com/actions/managing-workflow-runs/manually-running-a-workflow
- 2: https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow?tool=webui
- 3: https://docs.github.com/en/actions/reference/workflows-and-actions/contexts
- 4: https://devcoops.com/github-head-ref-vs-ref-name/
- 5: https://github.com/github/docs/blob/main/content/actions/reference/workflows-and-actions/variables.md
- 6: https://docs.github.com/en/actions/reference/workflows-and-actions/variables
- 7: https://github.com/github/docs/blob/main/content/actions/reference/workflows-and-actions/contexts.md
- 8: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax?use_case=
🏁 Script executed:
python3 - <<'PY'
from pathlib import Path
import re
p = Path(".github/workflows/i18n-update-core.yaml")
text = p.read_text()
manual_job = "github.event_name == 'workflow_dispatch'" in text
head_ref_commands = re.findall(r"git\s+(?:fetch|checkout|push)[^\n]*github\.head_ref", text)
ref_name_present = "github.ref_name" in text
print({
"manual_dispatch_enables_job": manual_job,
"commit_commands_using_head_ref": head_ref_commands,
"ref_name_present": ref_name_present,
})
PYRepository: Comfy-Org/ComfyUI_frontend
Length of output: 418
Use the selected branch for manual dispatches.
Manual runs leave github.head_ref empty, so the fetch, checkout, and push commands do not target a branch. Use ${{ github.head_ref || github.ref_name }} and reject tag refs before pushing.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/i18n-update-core.yaml around lines 7 - 11, Update the
workflow’s manual-dispatch branch handling to use `${{ github.head_ref ||
github.ref_name }}` for fetch, checkout, and push operations. Add validation
that rejects tag refs before any push occurs, while preserving the existing
branch behavior for pull-request runs.
Source: MCP tools
| id: translate | ||
| # continue-on-error so completed entry files (written and recorded in | ||
| # the manifest even when another file fails) still get committed; the | ||
| # final step re-surfaces the failure | ||
| continue-on-error: true | ||
| run: pnpm locale ${{ inputs.allow_prune == true && '--allow-prune' || '' }} && pnpm format |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
file=.github/workflows/i18n-update-core.yaml
rg -n -C2 \
'id: translate|continue-on-error|pnpm locale|pnpm format|steps\.translate\.outcome' \
"$file"Repository: Comfy-Org/ComfyUI_frontend
Length of output: 1026
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
file=.github/workflows/i18n-update-core.yaml
sed -n '1,100p' "$file"
printf '\n--- package scripts ---\n'
rg -n -C2 '"(locale|format)"|locale|format' package.json pnpm-workspace.yaml 2>/dev/null || trueRepository: Comfy-Org/ComfyUI_frontend
Length of output: 4582
🏁 Script executed:
#!/usr/bin/env bash
set -u
run_case() {
local locale_status="$1"
local format_status="$2"
local outcome=success
if (( locale_status == 0 )); then
(( format_status == 0 )) || outcome=failure
else
outcome=failure
fi
printf 'pnpm locale=%s, pnpm format=%s -> steps.translate.outcome=%s\n' \
"$locale_status" "$format_status" "$outcome"
}
run_case 0 0
run_case 0 1
run_case 1 0Repository: Comfy-Org/ComfyUI_frontend
Length of output: 356
Separate translation and formatting status
If pnpm locale succeeds but pnpm format fails, steps.translate.outcome is failure, so the final step incorrectly reports pnpm locale failed. Track formatting separately or record separate outcomes.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/i18n-update-core.yaml around lines 58 - 63, Separate the
translation and formatting commands in the workflow so their outcomes are
tracked independently. Update the final failure-reporting step to distinguish a
failed pnpm locale command from a failed pnpm format command, while preserving
continue-on-error behavior for committing completed translation files.
Source: MCP tools
| } | ||
|
|
||
| const states = loadLocaleFileStates(config, outputDir, plans) | ||
| const orphans = orphanedOutputFiles(outputDir, config, filenames) |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Require --allow-prune before deleting orphaned locale files.
oversizedPrunes only evaluates files still present in src/locales/en. If collection omits an entire entry file, it has no SourcePlan. Lines 449 and 581 then delete that file for every output locale without a threshold check or --allow-prune.
Gate orphan deletion behind --allow-prune, or calculate its recorded leaf count and apply the same threshold. Add coverage for a missing English entry file.
Proposed fix
const orphans = orphanedOutputFiles(outputDir, config, filenames)
+if (orphans.length > 0 && !check && !argv.includes('--allow-prune')) {
+ throw new Error(
+ `Refusing to delete ${orphans.length} orphaned locale files. ` +
+ 'Verify the English sources, or rerun with --allow-prune.'
+ )
+}
if (check) {Also applies to: 581-581
🧰 Tools
🪛 ast-grep (0.45.1)
[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFileSync } from 'node:child_process'
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(detect-child-process-typescript)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@scripts/i18n/update-locales.ts` at line 449, Require the --allow-prune option
before deleting files identified by orphanedOutputFiles in the pruning flows
around the orphanedOutputFiles call and its corresponding deletion path. Ensure
orphaned locale files are never removed without explicit permission, including
entries absent from src/locales/en, and add coverage for a missing English entry
file.
| would delete an implausibly large share of a file's keys abort that file | ||
| without writing — that usually means `collect-i18n` observed a partial app; | ||
| rerun with `--allow-prune` (or the `allow_prune` input on the manual workflow | ||
| dispatch) only after confirming the English sources are complete. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Describe unsafe-prune handling as a run-level abort.
scripts/i18n/update-locales.ts collects oversized prune plans and throws before loading locale states or writing outputs when --allow-prune is absent. Therefore, the generation run stops before any locale file is written. The phrase “abort that file” implies that other files continue.
Change the wording to “abort the run before writing” or change the implementation to provide true per-file continuation.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/locales/CONTRIBUTING.md` around lines 122 - 125, The documentation
wording should reflect run-level behavior: replace “abort that file without
writing” with language stating that an unsafe prune aborts the entire generation
run before any locale files are written. Keep the existing guidance about using
--allow-prune only after verifying complete English sources.
Apply the same fix in `@src/locales/CONTRIBUTING.md` around lines 131 - 133.
benjcooley
left a comment
There was a problem hiding this comment.
Approving. I re-verified the fixes by executing the pipeline code against the real locale data rather than reading the diff.
Blocker (#7, mass prune) — closed. My original repro is now refused:
BLOCKED main.json full `manager` subtree lost (repro) 129/4117 (3.1%)
BLOCKED nodeDefs half the file lost 4541/9082 (50%)
ALLOWED commands legit cleanup of 10 10/124 (8.1%)
Per-file rather than aggregate is a sharper design than what I suggested — a halved commands.json can't hide under a corpus-wide threshold.
Placeholder audit (#1, #2) — closed. Running collectPendingLeaves + auditProtectedLiterals as reportCheck now calls them, against real en/zh main.json: pending 21 -> 39, audit errors 0 -> 19. g.searchPlaceholder, gatedModelsHint, and workspacePanel.members.membersCount all re-queue for repair. The knownViolations baseline being per-file and self-clearing on revalidation is a good call — it makes the backlog explicit and auditable instead of invisible, which is what I was actually after.
On #3 — you were right and I was wrong. My suggested fallback (previous = source on an unreadable blob) would have advanced the manifest past an unread baseline and permanently skipped those retranslations. Splitting the error types and degrading only --check is the correct call.
On #4 — you found more than I did. I had verified oxfmt and serializeLocale currently agree and filed it as latent fragility. The ci-lint-format.yaml auto-commit path makes it a live second writer. Good catch.
Also noted: the prototype-pollution hardening in rebuildObject, manifest hash validation before git argv, and mapWithConcurrency halting dispatch on first failure — none of which were asked for.
Two non-blocking items:
- PR description is stale. It still says "No new dependencies — the OpenAI API is called directly," but this now depends on the
openaiSDK. The declaration is correct (devDependency,catalog:, lockfile updated) so nothing ships to users — the description just needs a line. - Residual prune window. Deletions under 2% still pass silently: roughly 180
nodeDefskeys, about 2,300 strings across 13 locales. Inherent to any threshold and a fine tradeoff, just worth knowing the floor isn't zero.
CI is green across the board. Nice work on the turnaround.
|
Smuggling in now and fixing rest of Christian's concerns in a followup, since diff is growing and things are generally nonblocking |
## Summary Split the existing user-facing and correctness repairs out of Comfy-Org#15062 so the framework migration can be reviewed independently. ## Changes - Applies the locale-data repairs already present in Comfy-Org#15062 onto current `main`, preserving translations that were independently updated on `main` in the meantime. - Repairs the stale, corrupted, missing, and leftover locale values already included in Comfy-Org#15062. - Fixes the custom-node locale workflow copy path (`temp/diff`, not `ComfyUI_frontend/temp/diff`). - Contains no i18n framework or dependency migration and no newly authored translations. ## Validation - Semantic three-way comparison against Comfy-Org#15062 original repair patch for all 26 affected locale files. - JSON parse and format validation passed. - Pre-commit checks, including `knip`, passed. Extracted mechanically from Comfy-Org#15062; no repair content was reauthored.
## Summary Wire the previously dormant `scripts/tsconfig.json` into a runnable check (`pnpm typecheck:scripts`) and run it in the lint-format-verify CI action, so type errors in `scripts/` no longer land silently. ## Changes - **What**: `scripts/tsconfig.json` gains the `node`/`vitest`/`vite/client` types and the repo's ambient declaration includes (mirroring `browser_tests/tsconfig.json`), runs via `vue-tsc` because scripts transitively import `.vue` modules, and disables incremental state so repeat runs cannot report stale results. New `typecheck:scripts` script + CI step. - `scripts/vite-define-shim.ts` drops its `declare global` block — `global.d.ts` and `src/platform/distribution/types.ts` already declare those constants ambiently, and duplicate declarations are a compile error once they share a program. - Pre-existing strictness errors in `collect-i18n-general.ts`, `collect-i18n-node-defs.ts`, `nodeDefLocaleSerializer.test.ts`, and `perf-report.ts` are suppressed with `@ts-expect-error` for now rather than fixed. - `collect-i18n-general.ts` imports `formatUtil` via the package's exports map instead of a cross-package relative path (latent `import-x/no-relative-packages` error surfaced by lint-staged on first touch). ## Review Focus Whether suppressing the pre-existing errors is acceptable versus fixing them here; and the shim's deleted `declare global` block (its only importer is `collect-i18n-general.ts`, and no other tsconfig checks the shim). Stacked on #15062. --------- Co-authored-by: Alexander Brown <drjkl@comfy.org> Co-authored-by: Amp <amp@ampcode.com>
Summary
Replace the
@lobehub/i18n-clitranslation step with an in-house pipeline (scripts/i18n/) so changed English source strings are retranslated, removed keys are pruned, and protected syntax survives translation byte-for-byte.The user-facing and correctness repairs were split into #15137 (merged). This PR is strictly the framework migration.
Changes
pnpm localenow runsscripts/i18n/update-locales.ts. It records the English sources of the last successful run as git blob hashes insrc/locales/.source-manifest.json, diffs them against the currentsrc/locales/en/*.jsonto invalidate changed and deleted keys, and rebuilds every output locale from the English structure.<Picture N>,17k+5, quotedmatchandmax), retries corrupted translations, and aborts without writing if corruption persists.pnpm locale:checkreports pending work offline.collect-i18nand formatting order.@lobehub/i18n-cliand.i18nrc.cjs; configuration now lives inscripts/i18n/config.ts.openaiSDK (the one new dependency, dev-only with no transitive dependencies), which owns transport retries, timeouts, and typed completion parsing; the pipeline keeps only domain-level retries for truncated or malformed completions.Review Focus
Manifest advancement only after full validation; rebuild-from-source semantics; translation retry and validation behavior; and source-provenance handling.
Depends on #15137 (merged). Supersedes #15024.
FE-1499