-
-
Notifications
You must be signed in to change notification settings - Fork 718
Open
Description
Environment
Classic nuxt 3 project with this as nuxt.config :
modules: ["@nuxt/content", "@nuxtjs/i18n", '@nuxt/devtools'],
content: {
locales:[
'en', 'fr'
],
defaultLocale: 'fr'
},
i18n: {
strategy: 'prefix',
defaultLocale: 'fr',
baseUrl: process.env.BASE_URL || 'https://localhost:3000',
detectBrowserLanguage: {
useCookie: true,
cookieKey: 'i18n_redirected',
redirectOn: 'root', // recommended
},
locales: [
{
code: 'en',
iso: 'en-US'
},
{
code: 'fr',
iso: 'fr-FR'
}
]
}
Reproduction
Use a catchall page [...slug].vue
in the pages directory with the same structure as me & same nuxt config
Try to fetch all pages :
const data = await queryContent().where({ _locale: locale.value }).find()
console.log(data)
But when you will use :
const { path } = useRoute()
const { locale } = useI18n()
const data = await queryContent().where({ _locale: locale.value, _path: path }).findOne()
console.log(data)
Describe the bug
where
query parameter is maybe broken with multi lang. It won't fetch the correct page but will fetch correctly multiples pages in the folder.
I believe it is not linked to the module i18n.
Additional context
No response
Logs
No response
davision
Metadata
Metadata
Assignees
Labels
No labels