Replies: 3 comments
-
This is my project structure!
|
Beta Was this translation helpful? Give feedback.
0 replies
-
And this is console.log ouput from const page = source.getPage(params.slug). Apparently, the locale does not set correctly... {
file: {
dirname: '',
name: 'index',
flattenedPath: 'index',
locale: undefined,
path: 'index.mdx'
},
url: '/./docs',
slugs: [],
data: {
body: [Function: MDXContent],
lastModified: undefined,
structuredData: { contents: [Array], headings: [] },
toc: [],
title: 'Home',
description: 'This page is in Index.',
_exports: Object [Module] {
default: [Getter],
frontmatter: [Getter],
lastModified: [Getter],
structuredData: [Getter],
toc: [Getter]
},
_file: {
path: 'index.mdx',
absolutePath: '/Users/zzzzzzzz/dev/web/content/docs/index.mdx'
}
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
A mistake: export const source = loader({
source: createMDXSource(docs, meta),
i18n: mdxi18n,
})
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an existing project which utilizing the next-international, and I want to incorporate with the fumadocs i18n setup. However, fumadocs does not recognize the i18n config with current setup properly. As a result, I can't retrieve the mdx content from the current locale like
index.fr.mdx
.I didn't add the
fumadocs-core/i18n
in middleware since I already have next-international middleware handling the entire project locale, but it maybe causing this issue?Here is the breakdown of how my current setup structure does.
First, I have middleware next-international like this:
Then create the fumadocs i18n config like this:
And this is my source.ts && source-config.ts
Then, this is the
src/app/[locale]/docs/[[...slug]]/page.tsx
. If I add the params.locale intosource.getPage(prams.slug, params.locale), it returns error since the
page` is undefined (without params.locale, it just shows the default locale mdx file contents.)As noted in the docs, I wrapped with the I18nProvider in the root layout like this:
Do you see any problem? @fuma-nama
Beta Was this translation helpful? Give feedback.
All reactions