I'm using the vue-i18n plugin to translate page titles. The locale is set in a Vuex store by a middleware. I then have a plugins/i18n.js
file that retrieves the locale from the store and passes it to i18n, which is then registered with Vue.
When translating page contents, eveything works and the locale in the store is used. For anything in the head()
function (such as the page title) however, the fallback locale is used, as the locale in the store appears to be undefined the moment the head()
function is executed.
Is there a way to circumvent this? I can provide code if needed. Sorry for asking this here. I've tried Stackoverflow, but questions like this seem to be too specific to get any answers.
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This bug report is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1671">#c1671</a>)</em></sub></div>