Several inlined translations from unused locals #7234
Replies: 2 comments
-
Hey @janus-reith — the only locales that are embedded are the ones that you install / pass to your Payload config accordingly. If you do discover that locales are embedded which are not being installed, please let us know. It's worth mentioning that custom locales, for example, in the case of plugins, custom field labels, and similar, likely do make their way to the frontend because they would be props on the field component(s). But that size is negligible compared to the size of the Payload-maintained translations which altogether add up to around ~400kb. In 3.x we greatly optimized that aspect. I will convert this to a Feature Request so that we can track the request of "paring down" any custom field-based translations / similar that are defined into only those requested. Should be able to get to that shortly and would happily accept a PR! |
Beta Was this translation helpful? Give feedback.
-
I believe that’s what’s happening. I’m only passing de and en and see a lot of different locales.
These are not from any of my custom fields. You can see it happen on https://next-payload-3-0-test.vercel.app/admin/login aswell. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Link to reproduction
No response
Payload Version
65
Node Version
20
Next.js Version
15.0.0-canary.58
Describe the Bug
Every admin page contains several inlined translations from unused locals.
All available translations seem to be inlined in the initial html, causing the bundle to be inflated.
Reproduction Steps
I need to check if this happens always or only if
supportedLanguages
are specified in the payload config.Adapters and Plugins
No response
Beta Was this translation helpful? Give feedback.
All reactions