Skip to content
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

Vuex store current locale is out of sync when swithing between locales if lazy loading is enabled #221

Closed
davecoggins opened this issue Feb 15, 2019 · 1 comment

Comments

@davecoggins
Copy link

Version

v5.3.0

Reproduction link

https://github.com/nuxt-community/nuxt-i18n

Steps to reproduce

Have lazy loading enabled and then switch between locales on frontend using the switchLocalePath helper.

What is expected ?

The vuex store locale value should update

What is actually happening?

It uses the previous locale value instead which means it lags by one locale as you switch between multiple locales

Additional comments?

I have tracked in down to the generated code in .nuxt/nuxt-i18n/middleware.js in the if statement checking if lazy loading is enabled the generated code has syncVuex(locale, messages) but it should be syncVuex(newLocale, messages)

Ace plugin btw :)

This bug report is available on Nuxt community (#c205)
@ghost ghost added the cmty:bug-report label Feb 15, 2019
@xibman
Copy link

xibman commented Feb 15, 2019

Same problem on 5.8.1

@paulgv paulgv closed this as completed in 77cc393 Feb 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants