nuxt-modules / i18n

I18n module for Nuxt
https://i18n.nuxtjs.org
MIT License
1.76k stars 485 forks source link

routes with `redirect` are not localized even if they do have a `children` array #2149

Open huang-julien opened 1 year ago

huang-julien commented 1 year ago

Environment


Reproduction

https://stackblitz.com/edit/nuxt-starter-nj4byf?file=modules%2Frouting%2Findex.ts,modules%2Frouting%2Ftest.vue

you can open the devtools and check the route list

Describe the bug

I18n module is not translating routes that contains the redirect field.

Additional context

No response

Logs

No response

kazupon commented 1 year ago

Thank you for your reporting! Lovely your contribution always!

I seem that your issue occurs because the nuxt i18n module extend pages added with extendPages. Your module is a nuxt module in a project. It is automatically imported by nuxt.

On the other hand, if you specify it in the modules option of nuxt.config.ts, the translation will work if you did that module before the nuxt i18n module. ref: https://github.com/nuxt-modules/i18n/issues/1894#issuecomment-1450281178

huang-julien commented 1 year ago

Oops my bad, i forgot to add it. I've updated the stackblitz reproduction. and the issue is still here