i18n icon indicating copy to clipboard operation
i18n copied to clipboard

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

Open huang-julien opened this issue 2 years ago • 2 comments

Environment


  • Operating System: Windows_NT
  • Node Version: v16.20.0
  • Nuxt Version: 3.5.2
  • Nitro Version: 2.4.1
  • Package Manager: [email protected]
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

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

huang-julien avatar Jun 12 '23 13:06 huang-julien

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

kazupon avatar Jun 13 '23 05:06 kazupon

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

huang-julien avatar Jun 13 '23 07:06 huang-julien