-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New docs #4181
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
base: main
Are you sure you want to change the base?
New docs #4181
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| localeMap: { | ||
| 'en-US': { language: 'english' }, | ||
| 'fr-FR': { language: 'french' }, | ||
| 'ja-FR': { language: 'japanese' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The locale code 'ja-FR' is invalid and should be 'ja' to match the actual Japanese content files and be a valid locale code.
View Details
📝 Patch Details
diff --git a/docs/app/[lang]/layout.tsx b/docs/app/[lang]/layout.tsx
index 54538b3..225aeef 100644
--- a/docs/app/[lang]/layout.tsx
+++ b/docs/app/[lang]/layout.tsx
@@ -51,7 +51,7 @@ const { provider } = defineI18nUI(i18n, {
'fr-FR': {
displayName: 'French'
},
- 'ja-FR': {
+ 'ja': {
displayName: 'Japanese'
},
ko: {
diff --git a/docs/app/api/search/route.ts b/docs/app/api/search/route.ts
index 8ea494c..1b655b5 100644
--- a/docs/app/api/search/route.ts
+++ b/docs/app/api/search/route.ts
@@ -7,7 +7,7 @@ export const { GET } = createFromSource(source, {
localeMap: {
'en-US': { language: 'english' },
'fr-FR': { language: 'french' },
- 'ja-FR': { language: 'japanese' },
+ 'ja': { language: 'japanese' },
'pt-BR': { language: 'portuguese' },
'zh-CN': { language: 'chinese' },
ko: { language: 'korean' },
diff --git a/docs/lib/geistdocs/i18n.ts b/docs/lib/geistdocs/i18n.ts
index ab7bc54..fc2ee02 100644
--- a/docs/lib/geistdocs/i18n.ts
+++ b/docs/lib/geistdocs/i18n.ts
@@ -3,5 +3,5 @@ import { defineI18n } from 'fumadocs-core/i18n'
export const i18n = defineI18n({
defaultLanguage: 'en-US',
hideLocale: 'default-locale',
- languages: ['en-US', 'fr-FR', 'ja-FR', 'ko', 'pt-BR', 'ru', 'zh-CN']
+ languages: ['en-US', 'fr-FR', 'ja', 'ko', 'pt-BR', 'ru', 'zh-CN']
})
Analysis
Invalid locale code 'ja-FR' prevents search and routing from finding Japanese content
What fails: Search route and i18n system fail to properly map content because the locale configuration uses 'ja-FR' but actual content files use .ja.mdx suffix, causing routing mismatches for Japanese language content.
How to reproduce:
- Navigate to a Japanese page via
/ja/docs/... - Attempt to search for content on a Japanese page
- Observe that search and content routing don't properly recognize the Japanese locale
Result: Japanese content files (e.g., docs/content/blog/swr-v1.ja.mdx) are named with .ja suffix, but the locale configuration in three files uses ja-FR:
docs/app/api/search/route.tsline 10:'ja-FR': { language: 'japanese' }docs/lib/geistdocs/i18n.tsline 6:languages: [..., 'ja-FR', ...]docs/app/[lang]/layout.tsxline 54:'ja-FR': { displayName: 'Japanese' }
Expected: According to Fumadocs page conventions, locale codes in configuration must match file suffixes exactly. The dot parser appends .{locale} to filenames - files are get-started.cn.mdx, not get-started.cn-XX.mdx.
Additionally, BCP 47 language tag standard specifies that ISO 639-1 code for Japanese is ja, and recommends "keep your language tag as short as possible" without regional suffixes unless necessary for disambiguation.
Fix: Changed all three occurrences of 'ja-FR' to 'ja' to match actual content file naming (*.ja.mdx) and conform to language tag standards.
No description provided.