-
-
Notifications
You must be signed in to change notification settings - Fork 483
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
fix(lazy): make client use translations loaded on the server #823
Conversation
Instead of client importing and processing messages (translations) itself on load pass already loaded messages from the server through nuxtState. This will in most cases allow avoiding triggering an extra network request to fetch lang file for given locale. Slight behavior change: The client will no longer import the lang file itself for the initially used locale. That means that if the lang file has exported a function, it will only be called on the server and not the client. This matches behavior of "asyncData" and I think it makes more sense in general. Resolves #486 Resolves #663
New release as well? |
Published in v6.13.3 |
Great )).... |
What exact configuration do you have in mind? |
We use |
for me it still doesn't work since process.server is undefined |
Instead of client importing and processing messages (translations)
itself on load, pass already loaded messages from the server through
"nuxtState". This will in most cases allow avoiding triggering an extra
network request to fetch lang file for the given locale.
Slight behavior change: The client will no longer import the lang file
itself for the initially used locale. That means that if the lang file
has exported a function, it will only be called on the server and not on
the client. This matches behavior of "asyncData" and I think it makes
more sense in general.
Resolves #486
Resolves #663