Skip to content

Conversation

@haydenbleasel
Copy link
Member

No description provided.

@vercel
Copy link

vercel bot commented Nov 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
swr Error Error Nov 18, 2025 8:15pm

localeMap: {
'en-US': { language: 'english' },
'fr-FR': { language: 'french' },
'ja-FR': { language: 'japanese' },
Copy link

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:

  1. Navigate to a Japanese page via /ja/docs/...
  2. Attempt to search for content on a Japanese page
  3. 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.ts line 10: 'ja-FR': { language: 'japanese' }
  • docs/lib/geistdocs/i18n.ts line 6: languages: [..., 'ja-FR', ...]
  • docs/app/[lang]/layout.tsx line 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.

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.

2 participants