Skip to content

Conversation

@Muska-Ami
Copy link
Contributor

@Muska-Ami Muska-Ami commented Jan 22, 2026

This PR fixed i18n collections generation and path solution.

  1. when locale is xx-XX (like zh-CN pt-BR), replace collection name to xx_XX (zh_CN)
  2. when call queryCollection, lowercase xx-XX (zh_CN to zh-cn) to ensure that path is resolved properly.
  3. fix when i18n is enabled, you can't create /lang/slug path due router will resolve it as /lang/lang?, but you still can't routing your doc to /lang/lang (e.g.: /en/en will cause a 404 Page Not Found result)
  4. Fix a bug in Fix i18n collection name strategy #1246, which case you couldn't use zh-CN or pt-BR language code in configuration.

@vercel
Copy link

vercel bot commented Jan 22, 2026

@Muska-Ami is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 22, 2026

Open in StackBlitz

npm i https://pkg.pr.new/create-docus@1254
npm i https://pkg.pr.new/docus@1254

commit: 7e23df2

@Muska-Ami
Copy link
Contributor Author

Muska-Ami commented Jan 22, 2026

Details I've found a strange behavior here: when you set collection name to `docs_zh_CN`, but structure files like this:
- content
  - zh-CN
    - ...

Nuxt Content will find docs_zh-CN instead docs_zh_CN here 🤔.

Fixed.

@Muska-Ami
Copy link
Contributor Author

This PR fixed i18n collections generation and path solution.

  1. when locale is xx-XX (like zh-CN pt-BR), replace collection name to xx_XX (zh_CN)
  2. when call queryCollection, lowercase xx-XX (zh_CN to zh-cn) to ensure that path is resolved properly.
  3. fix when i18n is enabled, you can't create /lang/slug path due router will resolve it as /lang/lang?, but you still can't routing your doc to /lang/lang (e.g.: /en/en will cause a 404 Page Not Found result)

@Muska-Ami Muska-Ami changed the title Fix i18n collection name generation Fix i18n collection name generation & path solution Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant