Skip to content

feat: lazy load translation files#5720

Open
therealemjy wants to merge 1 commit into
mainfrom
feat/lazy-load-translations
Open

feat: lazy load translation files#5720
therealemjy wants to merge 1 commit into
mainfrom
feat/lazy-load-translations

Conversation

@therealemjy

Copy link
Copy Markdown
Member

Changes

  • update how translation files so that only English translations are included in the original bundle. Other translations files are lazy loaded on demand, thus reducing the size of the initial bundle.

@changeset-bot

changeset-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4286542

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@venusprotocol/evm Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@therealemjy
therealemjy requested a review from cuzz-venus July 23, 2026 18:59
@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dapp-preview Ready Ready Preview Jul 23, 2026 8:12pm
dapp-testnet Ready Ready Preview Jul 23, 2026 8:12pm
venus.io Ready Ready Preview Jul 23, 2026 8:12pm

Request Review

@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown

Greptile Summary

Lazily loads non-English translation resources while retaining English in the initial bundle.

  • Removes translation payloads from supported-language metadata.
  • Adds a Vite glob loader and i18next backend for on-demand locale loading.
  • Configures i18next to use partially bundled language resources.

Confidence Score: 5/5

The PR appears safe to merge with no concrete changed-code defects identified.

Supported locale tags match the translation filenames, missing loader entries safely fall back to bundled English, and the dynamic lookup is constrained to Vite’s static import map.

Important Files Changed

Filename Overview
apps/evm/src/libs/translations/index.tsx Registers the lazy translation backend and keeps English as the bundled fallback resource.
apps/evm/src/libs/translations/loadTranslations/index.ts Resolves non-English translations from a statically generated Vite import map with an English fallback.
apps/evm/src/libs/translations/viteTranslationBackend/index.ts Adapts asynchronous translation loading to the i18next backend interface.
apps/evm/src/libs/translations/constants/index.ts Removes eagerly imported translation resources from supported-language metadata.

Reviews (1): Last reviewed commit: "feat: lazy load translation files" | Re-trigger Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da2b47ca22

ℹ️ 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".

Comment thread apps/evm/src/libs/translations/viteTranslationBackend/index.ts
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for ./apps/evm

Status Category Percentage Covered / Total
🔵 Lines 83.21% 52603 / 63211
🔵 Statements 83.21% 52603 / 63211
🔵 Functions 63.25% 699 / 1105
🔵 Branches 72.92% 6073 / 8328
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/evm/src/libs/translations/index.tsx 96.22% 77.77% 100% 96.22% 42-44
apps/evm/src/libs/translations/constants/index.ts 98.85% 0% 100% 98.85% 1
apps/evm/src/libs/translations/loadTranslations/index.ts 81.81% 0% 0% 81.81% 3, 8
apps/evm/src/libs/translations/viteTranslationBackend/index.ts 92.85% 50% 100% 92.85% 3
Generated in workflow #13921 for commit 4286542 by the Vitest Coverage Report Action

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.

1 participant