nuxt-modules / i18n

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

Content and i18n - Document not found for non-default locales #2901

Closed vlamic closed 5 months ago

vlamic commented 5 months ago

Environment


Reproduction

Hi,

I'm trying to setup a project which is driven by content and supports multiple languages, so I have created two dirs in my content folder: en and es. When I try to access the default routes (e.g. http://localhost:3000/ or http://localhost:3000/about), it loads the pages correctly. However, when I try to access non-default pages, it's not able to locate the content (e.g. http://localhost:3000/en/about or http://localhost:3000/en). Am I missing something?

I have uploaded a sample project here: https://github.com/vlamic/content-app-test

Content structure:

iScreen Shoter - Code - 240325120127

Pages structure:

iScreen Shoter - Code - 240325120213

Nuxt config:

iScreen Shoter - Code - 240325120230

Thank you!

Describe the bug

It's not able to find the localized pages in the content folder.

Additional context

No response

Logs

No response

kazupon commented 5 months ago

Thank you for your reporting!

I tried to disable nuxt-i18n module and reproduced this issue. So I faced same issue. I think this issue is nuxt content.

Please, check nuxt content docs agian. https://content.nuxt.com/

Thanks!

owocc commented 5 months ago

I also encountered the same problem as you, and then I cloned your project, and then I deleted the i18n configuration of the content, and then I visited the page, and the page can be accessed normally.

Screenshot 2024-04-14 at 16 02 25 Screenshot 2024-04-14 at 16 03 26 Screenshot 2024-04-14 at 16 03 33