The language files en.ts and lv.ts are called both on server and client.
I have two issues with this:
I think the file should be called only server-side. If i would have a $fetch() inside, let's say en.ts, then the $fetch would be called twice once on a server once on a client.
I think language files should be called per visit. Let's say I open only LV version of the page It should not trigger en.ts, but it does.
I am closing this issue as everything works as expected.
Explanation:
The requests are called twice, once server-side and once client-side, because messages are not transferred from server to client as it would make a huge response from the server if somebody loads 5MB worth of translations to their page.
This actually calls desired locale and default locale(for fallback).
Environment
StackBlitz
Reproduction
https://stackblitz.com/edit/github-orzjqc-1mczdr?file=lang%2Fen.ts,lang%2Flv.ts,pages%2Findex.vue,nuxt.config.ts
Describe the bug
The language files
en.ts
andlv.ts
are called both on server and client. I have two issues with this:en.ts
, then the $fetch would be called twice once on a server once on a client.en.ts
, but it does.Additional context
No response
Logs
No response