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

How to use localeRoute in vuex #1031

Closed

Comments

@udje
Copy link

udje commented Jan 18, 2021

How to use localeRoute in vuex store?

this.$router.push(this.localeRoute({ name: "home" }))

@rchl
Copy link
Collaborator

rchl commented Jan 18, 2021

nuxt-i18n only injects those extra functions on the app object so this.app.localePath should work.

(Standard inject mechanism would inject automatically in all contexts, which would make it available, but it would add a $ prefix to the function name. The alternative is to of course to do it manually. So I'd say that it should still be fixed/added, one way or another.)

rchl added a commit that referenced this issue Mar 8, 2021
The '$i18n' was already there but not `localePath` and other "root" APIs.

Resolves #1031
@rchl rchl closed this as completed in #1098 Mar 8, 2021
rchl added a commit that referenced this issue Mar 8, 2021
The '$i18n' was already there but not `localePath` and other "root" APIs.

Resolves #1031
This was referenced Mar 10, 2021
This was referenced Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment