-
Hi, After reading two large issues from SvelteKit github, I decided to give a try with typesafe-i18n. But I'm concerned about one question: are the loaded translations limited to the strict minimum when I hit a specific route ? To clarify the question, having 100 translations, when I visit a I'm having a hard time to find this information :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @binajmen, no, currently all translations of the selected locale will be loaded. WorkaroundYou can manually split them if you think they are too large via the src/i18n/en - logged-out
- index.ts # login, reset-password etc.
- dashboard
- index.ts # everything you'll display on the dashboard
- settings
- index.ts # settings page
- index.ts # common translations Then you can load the required Something in this direction is planned for the futureI have some build-time optimizations in the pipeline, but I haven't started implementing them yet. Why it is not that important to only load the strings you are using:
|
Beta Was this translation helpful? Give feedback.
Hi @binajmen,
no, currently all translations of the selected locale will be loaded.
Workaround
You can manually split them if you think they are too large via the
namespaces
feature. So you could structure your translations like this:src/i18n/en
Then you can load the required
namespaces
depending on the route your user visits.Something in this direction is planned for the future
I have some build-time optimizations in the pipeline, but I haven't started implementing them yet.
Why it…