Skip to content

perf: lazy load translations - #3522

Merged
kulmann merged 1 commit into
mainfrom
perf/lazy-load-translations
Oct 2, 2026
Merged

kulmann merged 1 commit into
mainfrom
perf/lazy-load-translations

Conversation

@JammingBen

Copy link
Copy Markdown
Member

Description

Add a vite plugin that serves the translations as virtual modules: one module per package and language, and one loader map per package. The modules of all packages are bundled into one chunk per language, so only the current language is loaded. English loads nothing because gettext falls back to the msgid.

App translations can now be loaders. Custom translations now take precedence over app translations.

closes #3380

Numbers

Loaded bytes during page load:

Language Before (gzip / raw) After (gzip / raw) Saved (gzip / raw)
English 419 kB / 1,714 kB 0 kB 419 kB / 1,714 kB (-100%)
German 419 kB / 1,714 kB 34 kB / 116 kB 385 kB / 1,598 kB (-92%)

Lighthouse

Benchmark Before After
FCP 1.0 s 0.9 s
LCP 1.7 s 1.3 s
Score 92 96

Add a vite plugin that serves the translations as virtual modules: one
module per package and language, and one loader map per package. The
modules of all packages are bundled into one chunk per language, so only
the current language is loaded. English loads nothing because gettext
falls back to the msgid.

App translations can now be loaders. Custom translations now take
precedence over app translations.
@JammingBen
JammingBen force-pushed the perf/lazy-load-translations branch from b265932 to 7b57286 Compare October 1, 2026 12:19

@kulmann kulmann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🥳

@kulmann
kulmann merged commit 477303d into main Oct 2, 2026
31 checks passed
@kulmann
kulmann deleted the perf/lazy-load-translations branch October 2, 2026 12:39
@openclouders openclouders mentioned this pull request Oct 2, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Load only the current language's translations instead of all languages

2 participants