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
Interesting case. Thank you for finding the exact problem.
It's a bit unfortunate that vue-i18n defaults to en-US. I would argue that it's not doing the right thing but I guess I will have to add a workaround for that (maybe the way you did it).
#629)
When `defaultLocale` was not set, and there was locale with `en-US` code,
the code has failed to initialize locale (including failure to lazy-load lang
files) due to `newLocale === app.i18n.locale` check that returned true even
though we haven't fully initialized yet.
Resolves#628
Version
v6.6.0
Reproduction link
https://codesandbox.io/s/thirsty-fast-7iqw9
Steps to reproduce
What is expected ?
Load the translations correctly.
What is actually happening?
Translation messages are not being loaded.
The following warning is emitted on console:
$nuxt._i18n.messages
is empty.Additional comments?
Investigation of the problem origin
loadAndSetLocale
abort the translations loading whennewLocale === app.i18n.locale
:https://github.com/nuxt-community/nuxt-i18n/blob/v6.6.0/src/plugins/main.js#L139
And
app.i18n.locale
is been defined asen-US
onkazupon/vue-i18n
:https://github.com/kazupon/vue-i18n/blob/v8.x/src/index.js#L68
Workaround
I found a workaround but I don't know yet about the possible side effects:
Possible related thread on VueJS Forum:
https://forum.vuejs.org/t/i18n-cannot-translate-the-value-of-keypath/45334/4
The text was updated successfully, but these errors were encountered: