-
Notifications
You must be signed in to change notification settings - Fork 458
fix: enable immediate file saving for i18n translations #7785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughA configuration property Changes
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✨ Finishing touches
📜 Recent review detailsConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings🔇 Additional comments (1)
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 |
🎭 Playwright Test Results❌ Some tests failed ⏰ Completed at: 01/03/2026, 03:09:14 AM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 01/03/2026, 02:30:04 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
|
No dependency changes detected. Learn more about Socket for GitHub. 👍 No dependency changes detected in pull request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes the pt-BR locale generation issue by bootstrapping previously empty translation files with minimal valid JSON structure. The pt-BR locale was added over a month ago but remained empty because the lobe-i18n tool skips completely empty {} objects during its diff comparison. By adding a single top-level key to each of the four locale files, the tool will now properly detect missing translations and queue pt-BR for automatic translation generation.
Key Changes:
- Bootstrapped all four pt-BR locale files with minimal top-level structure to trigger the i18n workflow
- Added temporary workflow modification to enable testing on the PR branch (must be removed before merge)
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/locales/pt-BR/main.json |
Added "g": {} key to bootstrap the main translation file |
src/locales/pt-BR/commands.json |
Added "Comfy_Canvas_FitView": {} key to bootstrap the commands translation file |
src/locales/pt-BR/settings.json |
Added "Comfy_DevMode": {} key to bootstrap the settings translation file |
src/locales/pt-BR/nodeDefs.json |
Added "AddNoise": {} key to bootstrap the node definitions translation file |
.github/workflows/i18n-update-core.yaml |
Temporary modification to enable i18n workflow on this branch for testing - must be reverted before merge |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 3.21 MB (baseline 3.21 MB) • ⚪ 0 BMain entry bundles and manifests
Graph Workspace — 1000 kB (baseline 1000 kB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Views & Navigation — 6.63 kB (baseline 6.63 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Panels & Settings — 300 kB (baseline 300 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
UI Components — 199 kB (baseline 199 kB) • ⚪ 0 BReusable component library chunks
Data & Services — 12.5 kB (baseline 12.5 kB) • ⚪ 0 BStores, services, APIs, and repositories
Utilities & Hooks — 1.41 kB (baseline 1.41 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Vendor & Third-Party — 9.12 MB (baseline 9.12 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 3.47 MB (baseline 3.47 MB) • ⚪ 0 BBundles that do not match a named category
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (5)
.github/workflows/i18n-update-core.yamlsrc/locales/pt-BR/commands.jsonsrc/locales/pt-BR/main.jsonsrc/locales/pt-BR/nodeDefs.jsonsrc/locales/pt-BR/settings.json
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,vue,js,jsx,json,css}
📄 CodeRabbit inference engine (AGENTS.md)
Apply Prettier formatting with 2-space indentation, single quotes, no trailing semicolons, and 80-character line width
Files:
src/locales/pt-BR/commands.jsonsrc/locales/pt-BR/nodeDefs.jsonsrc/locales/pt-BR/settings.jsonsrc/locales/pt-BR/main.json
🧠 Learnings (3)
📓 Common learnings
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 6300
File: src/locales/en/main.json:774-780
Timestamp: 2025-12-09T04:35:43.971Z
Learning: In the Comfy-Org/ComfyUI_frontend repository, locale files other than `src/locales/en/main.json` are generated automatically on every release. Developers only need to add English (en) key/values in `src/locales/en/main.json` when making PRs; manual updates to other locale files (fr, ja, ko, ru, zh, zh-TW, es, ar, tr, etc.) are not required and should not be suggested in reviews.
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/{components,composables}/**/*.{ts,tsx,vue} : Use vue-i18n for ALL user-facing strings by adding them to `src/locales/en/main.json`
📚 Learning: 2025-12-09T04:35:43.971Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 6300
File: src/locales/en/main.json:774-780
Timestamp: 2025-12-09T04:35:43.971Z
Learning: In the Comfy-Org/ComfyUI_frontend repository, locale files other than `src/locales/en/main.json` are generated automatically on every release. Developers only need to add English (en) key/values in `src/locales/en/main.json` when making PRs; manual updates to other locale files (fr, ja, ko, ru, zh, zh-TW, es, ar, tr, etc.) are not required and should not be suggested in reviews.
Applied to files:
src/locales/pt-BR/commands.jsonsrc/locales/pt-BR/settings.jsonsrc/locales/pt-BR/main.json
📚 Learning: 2025-12-12T23:02:37.473Z
Learnt from: Myestery
Repo: Comfy-Org/ComfyUI_frontend PR: 7422
File: .github/workflows/pr-update-playwright-expectations.yaml:131-135
Timestamp: 2025-12-12T23:02:37.473Z
Learning: In the `.github/workflows/pr-update-playwright-expectations.yaml` workflow in the Comfy-Org/ComfyUI_frontend repository, the snapshot update process is intentionally scoped to only add and update snapshot images. Deletions of snapshot files are handled explicitly outside this workflow and should not be suggested as part of this automation.
Applied to files:
.github/workflows/i18n-update-core.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Cleanup artifacts
- GitHub Check: lint-and-format
- GitHub Check: setup
- GitHub Check: test
- GitHub Check: collect
- GitHub Check: update-locales
🔇 Additional comments (2)
src/locales/pt-BR/main.json (1)
1-3: The "g" key is present in the English source with appropriate translation entries. The bootstrap structure is correct for the auto-generated locale file pattern.src/locales/pt-BR/settings.json (1)
1-3: Bootstrapping implementation is correct.The
Comfy_DevModekey addition follows the correct pattern and the key exists insrc/locales/en/settings.json. Per the locale automation, pt-BR files are generated on each release, making this a valid bootstrapping case for enabling that automation.
| # [TEST ONLY - REMOVE BEFORE MERGE] Added sno-fix-pt-br for testing pt-BR locale generation fix | ||
| if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.head.repo.full_name == github.repository && (startsWith(github.head_ref, 'version-bump-') || github.head_ref == 'sno-fix-pt-br')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove test-only workflow modification before merge.
The code explicitly states "[TEST ONLY - REMOVE BEFORE MERGE]". This temporary modification enables CI testing on the sno-fix-pt-br branch but must not be merged to main.
🔎 Revert to original condition before merge
- # [TEST ONLY - REMOVE BEFORE MERGE] Added sno-fix-pt-br for testing pt-BR locale generation fix
- if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.head.repo.full_name == github.repository && (startsWith(github.head_ref, 'version-bump-') || github.head_ref == 'sno-fix-pt-br'))
+ if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.head_ref, 'version-bump-'))📝 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.
| # [TEST ONLY - REMOVE BEFORE MERGE] Added sno-fix-pt-br for testing pt-BR locale generation fix | |
| if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.head.repo.full_name == github.repository && (startsWith(github.head_ref, 'version-bump-') || github.head_ref == 'sno-fix-pt-br')) | |
| if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.head_ref, 'version-bump-')) |
🤖 Prompt for AI Agents
.github/workflows/i18n-update-core.yaml around lines 15 to 16: the workflow
contains a test-only condition that allows runs for branch 'sno-fix-pt-br' and
is marked "[TEST ONLY - REMOVE BEFORE MERGE]"; remove the temporary
branch-specific exception so the if condition reverts to its intended production
logic (only workflow_dispatch or repository pushes/PRs for version-bump
branches) — delete the "|| github.head_ref == 'sno-fix-pt-br'" clause (and any
test comment) so the workflow no longer triggers for the test branch.
src/locales/pt-BR/nodeDefs.json
Outdated
| { | ||
| "AddNoise": {} | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# 1. Check if AddNoise exists in English nodeDefs
echo "=== Checking for AddNoise in en/nodeDefs.json ==="
if [ -f "src/locales/en/nodeDefs.json" ]; then
cat src/locales/en/nodeDefs.json | head -50
echo ""
echo "=== Searching for AddNoise key ==="
grep -o "AddNoise" src/locales/en/nodeDefs.json || echo "AddNoise NOT found"
else
echo "File src/locales/en/nodeDefs.json not found"
fi
echo ""
echo "=== Checking pt-BR/nodeDefs.json current state ==="
if [ -f "src/locales/pt-BR/nodeDefs.json" ]; then
wc -l src/locales/pt-BR/nodeDefs.json
cat src/locales/pt-BR/nodeDefs.json
else
echo "File src/locales/pt-BR/nodeDefs.json not found"
fi
echo ""
echo "=== Checking for git info on pt-BR/nodeDefs.json ==="
git log --oneline src/locales/pt-BR/nodeDefs.json 2>/dev/null | head -5 || echo "No git history available"Repository: Comfy-Org/ComfyUI_frontend
Length of output: 1356
This file should not be committed to the main branch.
The git history shows this commit is marked [TEST ONLY - REMOVE BEFORE MERGE]. Additionally, per project standards, locale files for non-English languages are auto-generated on release and should not be manually edited. The empty AddNoise object will be overwritten or regenerated by the automation workflow.
Remove this file from the PR and rely on the automated i18n generation to create the pt-BR translations.
🤖 Prompt for AI Agents
In src/locales/pt-BR/nodeDefs.json (lines 1-3) remove this file from the PR by
deleting it from the branch and committing that deletion (e.g., git rm
src/locales/pt-BR/nodeDefs.json && git commit -m "Remove autogenerated pt-BR
locale file - do not commit manually" && git push), or if you prefer to keep
commits tidy, remove it and amend/rebase to drop the test-only commit; do not
add manual edits to non-English locale files — rely on the automated i18n
generation for pt-BR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (4)
src/locales/pt-BR/commands.jsonsrc/locales/pt-BR/main.jsonsrc/locales/pt-BR/nodeDefs.jsonsrc/locales/pt-BR/settings.json
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,vue,js,jsx,json,css}
📄 CodeRabbit inference engine (AGENTS.md)
Apply Prettier formatting with 2-space indentation, single quotes, no trailing semicolons, and 80-character line width
Files:
src/locales/pt-BR/main.jsonsrc/locales/pt-BR/nodeDefs.jsonsrc/locales/pt-BR/commands.jsonsrc/locales/pt-BR/settings.json
🧠 Learnings (3)
📓 Common learnings
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 6300
File: src/locales/en/main.json:774-780
Timestamp: 2025-12-09T04:35:43.971Z
Learning: In the Comfy-Org/ComfyUI_frontend repository, locale files other than `src/locales/en/main.json` are generated automatically on every release. Developers only need to add English (en) key/values in `src/locales/en/main.json` when making PRs; manual updates to other locale files (fr, ja, ko, ru, zh, zh-TW, es, ar, tr, etc.) are not required and should not be suggested in reviews.
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/{components,composables}/**/*.{ts,tsx,vue} : Use vue-i18n for ALL user-facing strings by adding them to `src/locales/en/main.json`
📚 Learning: 2025-12-09T04:35:43.971Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 6300
File: src/locales/en/main.json:774-780
Timestamp: 2025-12-09T04:35:43.971Z
Learning: In the Comfy-Org/ComfyUI_frontend repository, locale files other than `src/locales/en/main.json` are generated automatically on every release. Developers only need to add English (en) key/values in `src/locales/en/main.json` when making PRs; manual updates to other locale files (fr, ja, ko, ru, zh, zh-TW, es, ar, tr, etc.) are not required and should not be suggested in reviews.
Applied to files:
src/locales/pt-BR/main.jsonsrc/locales/pt-BR/nodeDefs.jsonsrc/locales/pt-BR/commands.jsonsrc/locales/pt-BR/settings.json
📚 Learning: 2025-12-12T23:02:37.473Z
Learnt from: Myestery
Repo: Comfy-Org/ComfyUI_frontend PR: 7422
File: .github/workflows/pr-update-playwright-expectations.yaml:131-135
Timestamp: 2025-12-12T23:02:37.473Z
Learning: In the `.github/workflows/pr-update-playwright-expectations.yaml` workflow in the Comfy-Org/ComfyUI_frontend repository, the snapshot update process is intentionally scoped to only add and update snapshot images. Deletions of snapshot files are handled explicitly outside this workflow and should not be suggested as part of this automation.
Applied to files:
src/locales/pt-BR/nodeDefs.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: lint-and-format
- GitHub Check: setup
- GitHub Check: test
- GitHub Check: update-locales
- GitHub Check: collect
🔇 Additional comments (3)
src/locales/pt-BR/main.json (1)
1-5: Bootstrap approach approved; key verified in English source.This minimal English placeholder correctly addresses the chicken-and-egg problem where completely empty
{}files were not detected by lobe-i18n. Theg.emptykey exists inen/main.json, so the structure will trigger the i18n automation to generate actual Portuguese translations.src/locales/pt-BR/settings.json (1)
1-5: Remove manual edits to non-English locale files.The
pt-BR/settings.jsonfile is auto-generated on every release. Do not manually maintain or add content to locale files outside ofsrc/locales/en/main.json. Add theComfy_DevMode.namekey only to the English source file if it is not already present; other locales will be generated automatically during the next release.Likely an incorrect or invalid review comment.
src/locales/pt-BR/nodeDefs.json (1)
1-5: Bootstrap file approach is appropriate for this i18n automation fix.The Portuguese locale file with minimal English placeholders correctly triggers the lobe-i18n automation to generate actual translations. The
AddNoise.display_namekey exists in the English source and will be properly detected and translated.
src/locales/pt-BR/commands.json
Outdated
| { | ||
| "Comfy_Canvas_FitView": { | ||
| "label": "Fit View" | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check if the English commands file exists and has the key
echo "=== Checking English commands file ==="
if [ -f "src/locales/en/commands.json" ]; then
echo "✓ File exists"
echo "Checking for Comfy_Canvas_FitView key..."
jq -r '.Comfy_Canvas_FitView.label // "KEY_NOT_FOUND"' src/locales/en/commands.json
else
echo "✗ src/locales/en/commands.json not found"
fi
# Check locale directory structure
echo -e "\n=== Locale directory structure ==="
find src/locales -type d | head -20
# Look for i18n automation/configuration
echo -e "\n=== Looking for i18n automation setup ==="
fd -e "package.json|tsconfig|lobe-i18n|i18n" | head -20Repository: Comfy-Org/ComfyUI_frontend
Length of output: 452
🏁 Script executed:
#!/bin/bash
# Check for lobe-i18n or automation configuration
echo "=== Checking for i18n/lobe-i18n configuration ==="
rg -l "lobe-i18n|i18n.*generate|translate.*auto" --type json --type js --type ts | head -10
# Check if there's a script or workflow for locale generation
echo -e "\n=== Looking for locale generation scripts ==="
rg "locale|translate|i18n" package.json --context 2Repository: Comfy-Org/ComfyUI_frontend
Length of output: 1095
Remove the pt-BR/commands.json entry. Locale files for non-English languages are automatically generated by lobe-i18n on every release. Only add English key/values to src/locales/en/commands.json; the key already exists there as "Fit view to selected nodes". Manual edits to pt-BR and other non-English locale files will be overwritten during the next release and should not be included in PRs.
🤖 Prompt for AI Agents
In src/locales/pt-BR/commands.json around lines 1 to 5, remove the manual entry
for "Comfy_Canvas_FitView" because non-English locale files are generated
automatically; instead ensure the English key/value exists only in
src/locales/en/commands.json (the canonical source). Delete this file entry from
the PR so pt-BR is not modified and will remain managed by lobe-i18n during
releases.
Add saveImmediately: true to lobe-i18n configuration to fix pt-BR locale
generation. Without this option, translations from empty {} files are
generated by the API but not saved to disk, leaving files empty.
This enables proper bootstrapping of new locales from empty files.
This commit will be reverted after CI validates the fix works. It temporarily enables the i18n workflow to run on this PR branch.
This reverts commit 84545c218f46b0856e8d9a0d9d35d476cad59b28. The translations were successfully generated by CI, validating that the saveImmediately fix works. Removing them to keep the PR minimal - they will be regenerated automatically after merge.
This reverts commit cd7e937867a9bd2cd3ff90aae60dc8fc5b8e33ce. The test modification is no longer needed - CI has validated the fix works by successfully generating pt-BR translations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.i18nrc.cjs (1)
6-23: Reminder: Revert the temporary workflow changes before merging.According to the PR objectives, there's a temporary test modification in
.github/workflows/i18n-update-core.yaml(commit d08c503) that must be reverted before this PR is merged. Please ensure this workflow change is removed to avoid unintended CI behavior.
📜 Review details
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
.i18nrc.cjs
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 6300
File: src/locales/en/main.json:774-780
Timestamp: 2025-12-09T04:35:43.971Z
Learning: In the Comfy-Org/ComfyUI_frontend repository, locale files other than `src/locales/en/main.json` are generated automatically on every release. Developers only need to add English (en) key/values in `src/locales/en/main.json` when making PRs; manual updates to other locale files (fr, ja, ko, ru, zh, zh-TW, es, ar, tr, etc.) are not required and should not be suggested in reviews.
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/{components,composables}/**/*.{ts,tsx,vue} : Use vue-i18n for ALL user-facing strings by adding them to `src/locales/en/main.json`
🔇 Additional comments (1)
.i18nrc.cjs (1)
9-9: Clarify howsaveImmediatelyaddresses the root cause and whether locale file changes are part of this PR.
saveImmediatelyis a valid, documented configuration option for@lobehub/i18n-clithat writes translation results to output files as each chunk finishes. However, the PR objectives describe the root cause as lobe-i18n treating empty{}JSON objects as equal, preventing detection of pt-BR files needing translation. It's unclear how this write-timing option solves that detection problem. Please clarify:
- How does enabling
saveImmediatelyaddress the empty{}object equality issue?- Are the pt-BR locale file changes mentioned in the PR objectives (main.json, commands.json, settings.json, nodeDefs.json with minimal structure bootstrapping) part of this PR but omitted from review, or are they unnecessary with this config change?
Summary
Fixes the pt-BR locale generation issue by enabling immediate file persistence in the lobe-i18n configuration.
Problem
The pt-BR locale was added in PR #6943 with proper infrastructure, but translation files have remained empty (
{}) despite the i18n workflow running successfully on version-bump PRs.Root Cause
The
lobe-i18ntool has asaveImmediatelyconfiguration option (defaults tofalse) that controls whether translations are persisted to disk immediately during generation. When bootstrapping from completely empty{}JSON files, withoutsaveImmediately: true, the tool generates translations in memory but doesn't write them to disk, resulting in empty files.Evidence:
{}in all 4 files)saveImmediately: true: 18,787 lines generated across all 4 pt-BR filesSolution
Add
saveImmediately: trueto.i18nrc.cjsconfiguration:This ensures that when lobe-i18n generates translations from empty files, they are immediately written to disk rather than kept only in memory.
Validation
This PR's commit history demonstrates the fix works:
22e6e28f5: Applied thesaveImmediately: truefixcd7e93786: Temporarily enabled i18n workflow for this branch (for testing)84545c218: CI successfully generated complete pt-BR translations:commands.json: 327 linesmain.json: 2,458 linesnodeDefs.json: 15,539 linessettings.json: 463 lines85f282f98&05d097f7b: Reverted test commits to keep PR minimalChanges
.i18nrc.cjs: AddedsaveImmediately: trueconfiguration option (+1 line)Impact
After this fix is merged, future
version-bump-*PRs will automatically generate and persist pt-BR translations alongside all other locales, keeping Portuguese (Brazil) translations up-to-date with the codebase.References
Fixes #6943 (comment)