Skip to content
This repository was archived by the owner on Jul 10, 2019. It is now read-only.

Commit 26f445a

Browse files
committed
fix(i18n): change from store.state.locale to store.state.i18n.locale
1 parent 713fa8c commit 26f445a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/middleware/i18n.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default function({
3030
}
3131
// Set locale
3232
store.commit('i18n/SET_LANG', locale)
33-
app.i18n.locale = store.state.locale
33+
app.i18n.locale = store.state.i18n.locale
3434
// If route is /<defaultLocale>/... -> redirect to /...
3535
// if (locale === defaultLocale && route.fullPath.indexOf('/' + defaultLocale) === 0) {
3636
// const toReplace = '^/' + defaultLocale + (route.fullPath.indexOf('/' + defaultLocale + '/') === 0 ? '/' : '')

src/plugins/i18n.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default ({ app, store }): void => {
1111
// Set i18n instance on app
1212
// This way we can use it in middleware and pages asyncData/fetch
1313
app.i18n = new VueI18n({
14-
locale: store.state.locale,
14+
locale: store.state.i18n.locale,
1515
fallbackLocale: 'ja',
1616
messages: {
1717
ja: require('~/locales/ja.json')

0 commit comments

Comments
 (0)