Skip to content

Conversation

@reneshen0328
Copy link
Contributor

@reneshen0328 reneshen0328 commented Jan 27, 2026

What

Include the proper translation for group shared features package in BUIE CDN bundles.

Issue

The shared features translation has never worked inside BUIE after building CDN bundles.

In buildLocaleAssets.js when we call Webpack.config file we set the line of code to resolve the BUIE default i18n file instead of the properly translated bundled file (this includes all the groupSharedFeature messages) that we created by buildLanguages.js.
In Webpack.config: 'box-ui-elements-locale-data': path.resolve(i18n/${language})

Theoretically once I updated this path to use the already bundled file it should work. However we face another issue where the Babel is throwing error when transpiling @box imported files since the Babel config is different between frontend and BUIE.

Solution

Create mergeTranslations file to replace the frontend i18n/buildLanguageBundles which merges translations from all translationDependencies into the main i18n files without needing the Babel to transpile them again.

Testing Results

See the proper translation:
Screenshot 2026-01-27 at 2 57 01 PM

@reneshen0328 reneshen0328 requested a review from a team as a code owner January 27, 2026 22:44
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 27, 2026

Walkthrough

This pull request refactors the translation build process by replacing the previous bundled language generation approach with a new merge-based strategy. The buildLanguages.js script is updated to invoke mergeTranslations instead of buildLanguageBundles, and a new mergeTranslations.js script consolidates translations from dependency packages into main i18n files.

Changes

Cohort / File(s) Summary
Translation Build Refactor
scripts/buildLanguages.js, scripts/mergeTranslations.js
Modified build orchestration to replace bundling with translation merging; new script loads languages, iterates dependencies, and merges translations into main i18n files using VM sandbox parsing with fallback error handling and precedence logic for app messages.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Suggested labels

ready-to-merge

Suggested reviewers

  • jpan-box
  • tjiang-box
  • tjuanitas

Poem

🐰 Whiskers twitching with delight,
Translations merge throughout the night,
No bundles bundled, clean and neat,
Dependencies join, a language treat!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: fixing a shared features translation bundle issue by replacing the bundling strategy with a merge process.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description check ✅ Passed The PR description includes required context: what (translation fix), issue (Babel/webpack CDN issues), and solution (mergeTranslations replacement). Testing results with screenshot provided. Follows the general intent of documenting changes effectively.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants