Skip to content

Commit 8c56abb

Browse files
committed
feat(i18n): add English/Chinese language switching with English as default
Configure VitePress i18n with English root (/) and Chinese under /zh/. Translate all docs to English, add Chinese translations in zh/ directory, and fill previously empty homepage-data, market-data, and glossary pages. Made-with: Cursor
1 parent 96bd18b commit 8c56abb

50 files changed

Lines changed: 6258 additions & 2204 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vitepress/config.ts

Lines changed: 54 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { defineConfig } from 'vitepress'
2-
import { guideSidebar, conceptsSidebar, referenceSidebar } from './sidebar'
2+
import {
3+
guideSidebarEn, conceptsSidebarEn, referenceSidebarEn,
4+
guideSidebarZh, conceptsSidebarZh, referenceSidebarZh,
5+
} from './sidebar'
36
import { mermaidPlugin } from './theme/mermaidPlugin'
47

58
export default defineConfig({
@@ -18,23 +21,60 @@ export default defineConfig({
1821
},
1922
},
2023

24+
locales: {
25+
root: {
26+
label: 'English',
27+
lang: 'en',
28+
title: 'EvoMap',
29+
description: 'EvoMap - AI Self-Evolution Infrastructure | Official Documentation',
30+
themeConfig: {
31+
nav: [
32+
{ text: 'Home', link: '/' },
33+
{ text: 'Guide', link: '/guide/' },
34+
{ text: 'Concepts', link: '/concepts/' },
35+
{ text: 'Reference', link: '/reference/glossary' },
36+
],
37+
sidebar: {
38+
'/guide/': guideSidebarEn,
39+
'/concepts/': conceptsSidebarEn,
40+
'/reference/': referenceSidebarEn,
41+
},
42+
editLink: {
43+
pattern: 'https://github.com/evomap/evomap.github.io/edit/main/:path',
44+
text: 'Edit this page on GitHub',
45+
},
46+
},
47+
},
48+
zh: {
49+
label: '中文',
50+
lang: 'zh-CN',
51+
link: '/zh/',
52+
title: 'EvoMap',
53+
description: 'EvoMap - AI 自进化基础设施 | 官方文档',
54+
themeConfig: {
55+
nav: [
56+
{ text: '首页', link: '/zh/' },
57+
{ text: '功能指南', link: '/zh/guide/' },
58+
{ text: '概念说明', link: '/zh/concepts/' },
59+
{ text: '参考', link: '/zh/reference/glossary' },
60+
],
61+
sidebar: {
62+
'/zh/guide/': guideSidebarZh,
63+
'/zh/concepts/': conceptsSidebarZh,
64+
'/zh/reference/': referenceSidebarZh,
65+
},
66+
editLink: {
67+
pattern: 'https://github.com/evomap/evomap.github.io/edit/main/:path',
68+
text: '在 GitHub 上编辑此页',
69+
},
70+
},
71+
},
72+
},
73+
2174
themeConfig: {
2275
logo: '/icon.svg',
2376
siteTitle: 'EvoMap',
2477

25-
nav: [
26-
{ text: '首页', link: '/' },
27-
{ text: '功能指南', link: '/guide/' },
28-
{ text: '概念说明', link: '/concepts/' },
29-
{ text: '参考', link: '/reference/glossary' },
30-
],
31-
32-
sidebar: {
33-
'/guide/': guideSidebar,
34-
'/concepts/': conceptsSidebar,
35-
'/reference/': referenceSidebar,
36-
},
37-
3878
socialLinks: [
3979
{ icon: 'github', link: 'https://github.com/evomap' }
4080
],
@@ -47,10 +87,5 @@ export default defineConfig({
4787
search: {
4888
provider: 'local'
4989
},
50-
51-
editLink: {
52-
pattern: 'https://github.com/evomap/evomap.github.io/edit/main/:path',
53-
text: '在 GitHub 上编辑此页'
54-
},
5590
},
5691
})

.vitepress/sidebar/index.ts

Lines changed: 92 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,129 @@
11
import type { DefaultTheme } from 'vitepress'
22

3-
export const guideSidebar: DefaultTheme.SidebarItem[] = [
3+
// ─────────────────────────────── English ───────────────────────────────────
4+
5+
export const guideSidebarEn: DefaultTheme.SidebarItem[] = [
6+
{
7+
text: 'Getting Started',
8+
items: [
9+
{ text: 'Platform Overview', link: '/guide/' },
10+
]
11+
},
12+
{
13+
text: 'Core Features',
14+
items: [
15+
{ text: 'Market', link: '/guide/market' },
16+
{ text: 'Bounties', link: '/guide/bounties' },
17+
{ text: 'AI Ask', link: '/guide/ask' },
18+
{ text: 'Biology Dashboard', link: '/guide/biology' },
19+
{ text: 'Agent Management', link: '/guide/agents' },
20+
]
21+
},
22+
{
23+
text: 'Explore',
24+
items: [
25+
{ text: 'Knowledge Graph', link: '/guide/kg' },
26+
{ text: 'Sandbox', link: '/guide/sandbox' },
27+
{ text: 'Drift Bottle', link: '/guide/drift-bottle' },
28+
{ text: 'Reading Pipeline', link: '/guide/read' },
29+
{ text: 'AI Chat Assistant', link: '/guide/ai-chat' },
30+
]
31+
},
32+
{
33+
text: 'Platform Operations',
34+
items: [
35+
{ text: 'Pricing & Economy', link: '/guide/pricing' },
36+
{ text: 'Leaderboard', link: '/guide/leaderboard' },
37+
{ text: 'Council', link: '/guide/council' },
38+
{ text: 'Blog', link: '/guide/blog' },
39+
]
40+
},
41+
]
42+
43+
export const conceptsSidebarEn: DefaultTheme.SidebarItem[] = [
44+
{
45+
text: 'Concepts',
46+
items: [
47+
{ text: 'Overview', link: '/concepts/' },
48+
{ text: 'Homepage Data Explained', link: '/concepts/homepage-data' },
49+
{ text: 'Market Data Explained', link: '/concepts/market-data' },
50+
{ text: 'Ecosystem', link: '/concepts/ecosystem' },
51+
{ text: 'Evolution Mechanism', link: '/concepts/evolution-mechanism' },
52+
{ text: 'Agent Model', link: '/concepts/agent-model' },
53+
{ text: 'Data Pipeline', link: '/concepts/data-pipeline' },
54+
]
55+
},
56+
]
57+
58+
export const referenceSidebarEn: DefaultTheme.SidebarItem[] = [
59+
{
60+
text: 'Reference',
61+
items: [
62+
{ text: 'Glossary', link: '/reference/glossary' },
63+
]
64+
},
65+
]
66+
67+
// ─────────────────────────────── 中文 ──────────────────────────────────────
68+
69+
export const guideSidebarZh: DefaultTheme.SidebarItem[] = [
470
{
571
text: '入门',
672
items: [
7-
{ text: '平台概览', link: '/guide/' },
73+
{ text: '平台概览', link: '/zh/guide/' },
874
]
975
},
1076
{
1177
text: '核心功能',
1278
items: [
13-
{ text: '市场', link: '/guide/market' },
14-
{ text: '悬赏系统', link: '/guide/bounties' },
15-
{ text: 'AI 问答', link: '/guide/ask' },
16-
{ text: '生物学仪表盘', link: '/guide/biology' },
17-
{ text: '智能体管理', link: '/guide/agents' },
79+
{ text: '市场', link: '/zh/guide/market' },
80+
{ text: '悬赏系统', link: '/zh/guide/bounties' },
81+
{ text: 'AI 问答', link: '/zh/guide/ask' },
82+
{ text: '生物学仪表盘', link: '/zh/guide/biology' },
83+
{ text: '智能体管理', link: '/zh/guide/agents' },
1884
]
1985
},
2086
{
2187
text: '探索功能',
2288
items: [
23-
{ text: '知识图谱', link: '/guide/kg' },
24-
{ text: '沙盒实验', link: '/guide/sandbox' },
25-
{ text: '漂流瓶', link: '/guide/drift-bottle' },
26-
{ text: '阅读管道', link: '/guide/read' },
27-
{ text: 'AI 对话助手', link: '/guide/ai-chat' },
89+
{ text: '知识图谱', link: '/zh/guide/kg' },
90+
{ text: '沙盒实验', link: '/zh/guide/sandbox' },
91+
{ text: '漂流瓶', link: '/zh/guide/drift-bottle' },
92+
{ text: '阅读管道', link: '/zh/guide/read' },
93+
{ text: 'AI 对话助手', link: '/zh/guide/ai-chat' },
2894
]
2995
},
3096
{
3197
text: '平台运营',
3298
items: [
33-
{ text: '定价与经济', link: '/guide/pricing' },
34-
{ text: '排行榜', link: '/guide/leaderboard' },
35-
{ text: '议事会', link: '/guide/council' },
36-
{ text: '博客', link: '/guide/blog' },
99+
{ text: '定价与经济', link: '/zh/guide/pricing' },
100+
{ text: '排行榜', link: '/zh/guide/leaderboard' },
101+
{ text: '议事会', link: '/zh/guide/council' },
102+
{ text: '博客', link: '/zh/guide/blog' },
37103
]
38104
},
39105
]
40106

41-
export const conceptsSidebar: DefaultTheme.SidebarItem[] = [
107+
export const conceptsSidebarZh: DefaultTheme.SidebarItem[] = [
42108
{
43109
text: '概念说明',
44110
items: [
45-
{ text: '概览', link: '/concepts/' },
46-
{ text: '首页数据详解', link: '/concepts/homepage-data' },
47-
{ text: '市场数据详解', link: '/concepts/market-data' },
48-
{ text: '生态系统', link: '/concepts/ecosystem' },
49-
{ text: '进化机制', link: '/concepts/evolution-mechanism' },
50-
{ text: '智能体模型', link: '/concepts/agent-model' },
51-
{ text: '数据流与管道', link: '/concepts/data-pipeline' },
111+
{ text: '概览', link: '/zh/concepts/' },
112+
{ text: '首页数据详解', link: '/zh/concepts/homepage-data' },
113+
{ text: '市场数据详解', link: '/zh/concepts/market-data' },
114+
{ text: '生态系统', link: '/zh/concepts/ecosystem' },
115+
{ text: '进化机制', link: '/zh/concepts/evolution-mechanism' },
116+
{ text: '智能体模型', link: '/zh/concepts/agent-model' },
117+
{ text: '数据流与管道', link: '/zh/concepts/data-pipeline' },
52118
]
53119
},
54120
]
55121

56-
export const referenceSidebar: DefaultTheme.SidebarItem[] = [
122+
export const referenceSidebarZh: DefaultTheme.SidebarItem[] = [
57123
{
58124
text: '参考',
59125
items: [
60-
{ text: '术语表', link: '/reference/glossary' },
126+
{ text: '术语表', link: '/zh/reference/glossary' },
61127
]
62128
},
63129
]

0 commit comments

Comments
 (0)