You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: Update README with language configuration documentation
- Document i18n configuration in docs.site.json
- List all supported languages with translations
- Explain how to add new languages
- Update multi-language support features section
Co-authored-by: huangyiirene <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+41-8Lines changed: 41 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,10 @@ This repository contains the documentation for:
13
13
## Features
14
14
15
15
- 🌍 **Multi-language Support**:
16
-
- Source: English (`content/docs/*.mdx`)
17
-
- Target: Chinese (`content/docs/*.cn.mdx`) - *Auto-translated via AI using dot parser*
16
+
- Configurable via `docs.site.json`
17
+
- Built-in support for: English, Chinese, Japanese, French, German, Spanish
18
+
- Extensible: Easy to add new languages
19
+
- Auto-translation via AI CLI using dot parser convention
18
20
- 📝 **MDX Content**: Interactive documentation with Type-safe components.
19
21
- 🛠️ **Automated Workflows**:
20
22
- AI Translation CLI (`packages/cli`)
@@ -76,12 +78,43 @@ The guide covers:
76
78
77
79
### Internationalization (i18n)
78
80
79
-
The default language is configured in `lib/i18n.ts` as `en`. If you change the default language, you must also update the redirect destination in `vercel.json` to match (currently `/en/docs`).
81
+
Language configuration is managed in `content/docs.site.json`:
82
+
83
+
```json
84
+
{
85
+
"i18n": {
86
+
"enabled": true,
87
+
"defaultLanguage": "en",
88
+
"languages": ["en", "cn"]
89
+
}
90
+
}
91
+
```
92
+
93
+
**Configurable Options:**
94
+
-`enabled`: Enable/disable i18n support
95
+
-`defaultLanguage`: The default language for the site (e.g., "en")
96
+
-`languages`: Array of supported language codes (e.g., ["en", "cn", "ja", "fr"])
97
+
98
+
**Supported Languages:**
99
+
The system includes built-in UI translations for:
100
+
-`en` - English
101
+
-`cn` - Chinese (Simplified) / 简体中文
102
+
-`ja` - Japanese / 日本語
103
+
-`fr` - French / Français
104
+
-`de` - German / Deutsch
105
+
-`es` - Spanish / Español
106
+
107
+
To add a new language:
108
+
1. Add the language code to the `languages` array in `docs.site.json`
109
+
2. If UI translations don't exist, add them to `packages/site/lib/translations.ts`
110
+
3. Create content files with the language suffix (e.g., `file.{lang}.mdx`)
111
+
112
+
**Important:** If you change the default language, you must also update the redirect destination in `vercel.json` to match (currently `/en/docs`).
80
113
81
114
### Content Structure
82
115
83
-
Content files are located in `content/docs/` and use language suffixes:
84
-
-`{filename}.en.mdx` - English content
85
-
-`{filename}.cn.mdx` - Chinese content
86
-
-`meta.en.json` - English navigation
87
-
-`meta.cn.json` - Chinese navigation
116
+
Content files are located in `content/docs/` and use language suffixes based on the `languages` configuration:
0 commit comments