-
-
Notifications
You must be signed in to change notification settings - Fork 601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
queryContent does not support i18n #2589
Comments
I figured out how to do this! folder tree: content
├── EN
│ ├── 0.index.yml
│ ├── 1.docs
│ │ ├── 1.getting-started
│ │ │ ├── 1.index.md
│ │ │ ├── 2.installation.md
│ │ │ └── _dir.yml
│ │ └── _dir.yml
│ ├── 2.pricing.yml
│ ├── 3.blog
│ │ ├── 1.asian-cuisine.md
│ │ ├── 2.pyrenees.md
│ │ ├── 3.james-webb.md
│ │ ├── 4.meditation.md
│ │ ├── 5.animals.md
│ │ ├── 6.cryptocurrencies.md
│ │ └── 7.nuxt-ui.md
│ └── 3.blog.yml
└── RU
└── 0.index.yml nuxt.config.ts content: {
defaultLocale: 'EN',
locales: ['EN', 'BG', 'RU', 'FR']
},
i18n: {
vueI18n: './i18n.config.ts',
types: 'composition',
strategy: 'prefix_and_default',
defaultLocale: 'EN',
lazy: true,
langDir: 'locales',
locales: [
........
]
..... index.vue ....
const { locale: { value: localCode } } = useI18n()
const { data: page } = await useAsyncData('index', () => queryContent().locale(localCode).findOne())
if (!page.value) {
throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true })
}
.... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Reproduction
.
Describe the bug
i18n config
content config
Problem Description
When my address is
http://localhost:3000/en/doc/tutorial/getting
,queryContent
cannot find the documentWhat I can guarantee is that the output of localPath(route. path) is
en/doc/tutorial/getting started
Directory structure
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: