[backport core/1.36] fix: enable immediate file saving for i18n translations#8014
Merged
christian-byrne merged 1 commit intocore/1.36from Jan 13, 2026
Merged
Conversation
## 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>
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 01/13/2026, 05:15:56 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
🎭 Playwright Test Results❌ Some tests failed ⏰ Completed at: 01/13/2026, 05:21:18 AM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #7785 to
core/1.36Automatically created by backport workflow.
┆Issue is synchronized with this Notion page by Unito