Skip to content

Commit 87784b1

Browse files
authored
fix: locale change wait for page transition (#89)
* fix: change locale wait for page transition * tweak
1 parent d8dd4c2 commit 87784b1

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

nuxt.config.ts

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const config: NuxtConfig = {
5454
],
5555

5656
plugins: [
57+
{ src: '@/plugins/router.js' },
5758
{ src: '@/plugins/vuelidate.js' },
5859
{ src: '@/plugins/application.js' }
5960
],
@@ -68,6 +69,7 @@ const config: NuxtConfig = {
6869
{ code: 'ja', iso: 'ja-JP', name: '日本語', file: 'ja-JP.json' }
6970
],
7071
lazy: true,
72+
skipSettingLocaleOnNavigate: true,
7173
langDir: 'locales/',
7274
defaultLocale: 'ja',
7375
vueI18n: {

plugins/router.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default ({ app }) => {
2+
app.nuxt.defaultTransition.beforeEnter = () => {
3+
app.i18n.finalizePendingLocaleChange()
4+
}
5+
}

0 commit comments

Comments
 (0)