Sveltekit-i18n download all the language.json file #141
Answered
by
jarda-svoboda
VisionaryAppDev
asked this question in
Q&A
-
I have found this lib today and of course it's one of the cleanest and simplest lib. But it seems like it does load all the translation.json files even the page doesn't need those translation. So, isn't that will affect the page performance and consume a lot of bandwidth especially on a large project? |
Beta Was this translation helpful? Give feedback.
Answered by
jarda-svoboda
Sep 4, 2023
Replies: 1 comment 1 reply
-
Hi @VisionaryAppDev, thanks for your question.
I think this example might help you to understand |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
VisionaryAppDev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @VisionaryAppDev, thanks for your question.
The load mechanism is quite simple:
translations
object, serialized by locale, which is loaded instantly.loaders
array, defining which translation definitions (jsons) should be loaded for whichroutes
andlocales
.– when no
routes
are defined within a loader, then it's loaded together with the first page.I think this example might help you to understand
loaders
better.. (see theloaders
config here)