You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I've got the case that the global language changes depending on some api data:
asyncfetch(){constres=awaitthis.$apollo.query({query: eventSeriesBySlug,variables: {'slug': this.$route.params.slug}});this.eventSeries=res.data.eventSeriesBySlug;// "en"this.locale=this.eventSeries.language.short;// i18n works fine and the page updatesthis.$i18n.setLocale(this.locale);// just updates and stays at the locale when rendered client side this.$dayjs.locale(this.locale);}
The page / dayjs shows up for like 1 second in the right language but then switches back to whatever is standing in the nuxt config. (also watchable with {{ $dayjs.locale() }} "en" => "de" in my case)
I also experience this issue, in that locales are ignored when SSR.
This isn't an issue for all formats, as often it doesn't matter, but is and issue when formatting 'd' for instance, which would start Monday 0 got en-gb, but Sunday 0 for default.
So I've got the case that the global language changes depending on some api data:
The page / dayjs shows up for like 1 second in the right language but then switches back to whatever is standing in the nuxt config. (also watchable with {{ $dayjs.locale() }} "en" => "de" in my case)
I'm not sure if this is a bug or a missing feature or if there's a workaround for this (but stackoverflow is suspicious quiet on this).
Edit: This just happens when rendered server side! Client side it's fine. But when doing a hard reload, the switch appears. Link: https://stackoverflow.com/questions/71557315/set-global-dayjs-locale-at-nuxt-ssr
The text was updated successfully, but these errors were encountered: