Skip to content

[backport core/1.36] fix: enable immediate file saving for i18n translations#8014

Merged
christian-byrne merged 1 commit intocore/1.36from
backport-7785-to-core-1.36
Jan 13, 2026
Merged

[backport core/1.36] fix: enable immediate file saving for i18n translations#8014
christian-byrne merged 1 commit intocore/1.36from
backport-7785-to-core-1.36

Conversation

@comfy-pr-bot
Copy link
Member

@comfy-pr-bot comfy-pr-bot commented Jan 13, 2026

Backport of #7785 to core/1.36

Automatically created by backport workflow.

┆Issue is synchronized with this Notion page by Unito

## 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-i18n` tool has a `saveImmediately` configuration option
(defaults to `false`) that controls whether translations are persisted
to disk immediately during generation. When bootstrapping from
completely empty `{}` JSON files, without `saveImmediately: true`, the
tool generates translations in memory but doesn't write them to disk,
resulting in empty files.

**Evidence:**
- All other locales: ~1,931 lines each (previously bootstrapped)
- pt-BR before fix: 1 line (`{}` in all 4 files)
- CI workflow runs successfully but pt-BR files remain empty
- After adding `saveImmediately: true`: 18,787 lines generated across
all 4 pt-BR files

## Solution

Add `saveImmediately: true` to `.i18nrc.cjs` configuration:

```javascript
module.exports = defineConfig({
  modelName: 'gpt-4.1',
  splitToken: 1024,
  saveImmediately: true,  // ← Enables immediate file persistence
  entry: 'src/locales/en',
  entryLocale: 'en',
  output: 'src/locales',
  outputLocales: ['zh', 'zh-TW', 'ru', 'ja', 'ko', 'fr', 'es', 'ar', 'tr', 'pt-BR'],
  // ...
});
```

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:

1. **Commit `22e6e28f5`**: Applied the `saveImmediately: true` fix
2. **Commit `cd7e93786`**: Temporarily enabled i18n workflow for this
branch (for testing)
3. **Commit `84545c218`**: CI successfully generated complete pt-BR
translations:
   - `commands.json`: 327 lines
   - `main.json`: 2,458 lines
   - `nodeDefs.json`: 15,539 lines
   - `settings.json`: 463 lines
   - **Total: 18,787 lines of Portuguese translations**
4. **Commits `85f282f98` & `05d097f7b`**: Reverted test commits to keep
PR minimal

## Changes

- `.i18nrc.cjs`: Added `saveImmediately: true` configuration 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

- Original issue:
#6943 (comment)
- Related PR: #6943 (Portuguese (Brazil) locale addition)
- lobe-i18n documentation:
https://github.com/lobehub/lobe-cli-toolbox/tree/master/packages/lobe-i18n

Fixes #6943 (comment)

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alexander Brown <drjkl@comfy.org>
@comfy-pr-bot comfy-pr-bot added the backport Backporting a PR onto a release candidate label Jan 13, 2026
@comfy-pr-bot comfy-pr-bot requested a review from a team as a code owner January 13, 2026 05:14
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jan 13, 2026
@github-actions
Copy link

github-actions bot commented Jan 13, 2026

🎨 Storybook Build Status

Build completed successfully!

⏰ Completed at: 01/13/2026, 05:15:56 AM UTC

🔗 Links


🎉 Your Storybook is ready for review!

@github-actions
Copy link

github-actions bot commented Jan 13, 2026

🎭 Playwright Test Results

Some tests failed

⏰ Completed at: 01/13/2026, 05:21:18 AM UTC

📈 Summary

  • Total Tests: 510
  • Passed: 498 ✅
  • Failed: 1 ❌
  • Flaky: 3 ⚠️
  • Skipped: 8 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 488 / ❌ 1 / ⚠️ 2 / ⏭️ 8
  • chromium-2x: View Report • ✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • chromium-0.5x: View Report • ✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • mobile-chrome: View Report • ✅ 7 / ❌ 0 / ⚠️ 1 / ⏭️ 0

🎉 Click on the links above to view detailed test results for each browser configuration.

@christian-byrne christian-byrne merged commit ef74c22 into core/1.36 Jan 13, 2026
32 of 33 checks passed
@christian-byrne christian-byrne deleted the backport-7785-to-core-1.36 branch January 13, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Backporting a PR onto a release candidate size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants