-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lazy load language files to minimize download size #57
Comments
@jbaldivieso it may not fit to your needs/setup but I implemented it myself.
|
@FlorianWerndl–Thank you very much for sharing this! I took a closer look at the source code, and it appears that Since this doesn't seem like an edge case (right? the average user only wants an app/website in a single language), I think this process could be smoother/better documented. Here is what worked for me:
And then when the app mounts, I call logic that looks up/infers the language (cookie, local storage, request headers) and calls |
It appears that, despite having specified
splitJson: true
in the config, ultimately all translations get minified into the same file for my app. It would be ideal to lazily load languages only upon their activation. Once you have multiple languages with nontrivial amounts of content, the file size really starts to add up, with no benefit to your average single-language user.The text was updated successfully, but these errors were encountered: