Skip to content

Commit fe7f0d5

Browse files
authored
Merge pull request #2 from sxyseo/master
2 parents 7627467 + 9028d20 commit fe7f0d5

File tree

3 files changed

+257
-274
lines changed

3 files changed

+257
-274
lines changed

src/components/HomepageFeatures/index.tsx

Lines changed: 97 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,60 @@ import clsx from 'clsx';
33
import styles from './styles.module.css';
44
import Heading from "@theme/Heading";
55
import Link from '@docusaurus/Link';
6+
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
67

78
type FeatureItem = {
89
title: string;
910
description: ReactNode;
1011
icon?: ReactNode;
1112
};
1213

13-
const FeatureList: FeatureItem[] = [
14-
{
15-
title: '智能任务自动化',
16-
description: (
17-
<>
18-
利用 AutoDev Planner 结合 AI 模型,自动规划与执行复杂的开发任务(编码、测试、构建等),支持手动调整,简化工作流程。
19-
</>
20-
),
21-
icon: <div className={styles.featureIconBrain} />
22-
},
23-
{
24-
title: '高度定制化体验',
25-
description: (
26-
<>
27-
支持自定义智能体、私有模型及提示词指令,轻松打造满足个人、团队或企业特定需求的 AutoDev 工作流,提升开发效率。
28-
</>
29-
),
30-
icon: <div className={styles.featureIconSettings} />
31-
},
32-
{
33-
title: '精准上下文感知',
34-
description: (
35-
<>
36-
深度整合 IDE 插件并支持 MCP 协议,为 AI 提供丰富准确的项目上下文,显著减少 AI 幻觉,确保结果更可靠。
37-
</>
38-
),
39-
icon: <div className={styles.featureIconCode} />
40-
},
41-
];
14+
function useFeatureList() {
15+
const { i18n: { currentLocale } } = useDocusaurusContext();
16+
const isEnglish = currentLocale === 'en';
17+
18+
return [
19+
{
20+
title: isEnglish ? 'Intelligent Task Automation' : '智能任务自动化',
21+
description: isEnglish ? (
22+
<>
23+
Leverage AutoDev Planner with AI models to automatically plan and execute complex development tasks (coding, testing, building, etc.), supporting manual adjustments and simplifying workflows.
24+
</>
25+
) : (
26+
<>
27+
利用 AutoDev Planner 结合 AI 模型,自动规划与执行复杂的开发任务(编码、测试、构建等),支持手动调整,简化工作流程。
28+
</>
29+
),
30+
icon: <div className={styles.featureIconBrain} />
31+
},
32+
{
33+
title: isEnglish ? 'Highly Customizable Experience' : '高度定制化体验',
34+
description: isEnglish ? (
35+
<>
36+
Support for custom agents, private models, and prompt instructions, easily creating AutoDev workflows that meet the specific needs of individuals, teams, or enterprises to improve development efficiency.
37+
</>
38+
) : (
39+
<>
40+
支持自定义智能体、私有模型及提示词指令,轻松打造满足个人、团队或企业特定需求的 AutoDev 工作流,提升开发效率。
41+
</>
42+
),
43+
icon: <div className={styles.featureIconSettings} />
44+
},
45+
{
46+
title: isEnglish ? 'Precise Context Awareness' : '精准上下文感知',
47+
description: isEnglish ? (
48+
<>
49+
Deep integration with IDE plugins and support for MCP protocol, providing rich and accurate project context for AI, significantly reducing AI hallucinations and ensuring more reliable results.
50+
</>
51+
) : (
52+
<>
53+
深度整合 IDE 插件并支持 MCP 协议,为 AI 提供丰富准确的项目上下文,显著减少 AI 幻觉,确保结果更可靠。
54+
</>
55+
),
56+
icon: <div className={styles.featureIconCode} />
57+
},
58+
];
59+
}
4260

4361
function Feature({title, description, icon}: FeatureItem) {
4462
return (
@@ -56,7 +74,15 @@ function Feature({title, description, icon}: FeatureItem) {
5674

5775
// Quick links section
5876
function QuickLinks() {
59-
const links = [
77+
const { i18n: { currentLocale } } = useDocusaurusContext();
78+
const isEnglish = currentLocale === 'en';
79+
80+
const links = isEnglish ? [
81+
{ title: 'Installation Guide', description: 'Quickly set up AutoDev in your environment', link: '/quick-start' },
82+
{ title: 'AI Programmer', description: 'Explore AutoDev Sketch automatic coding', link: '/composer' },
83+
{ title: 'Customization', description: 'Learn how to customize AutoDev for your specific needs', link: '/customize' },
84+
{ title: 'Agents', description: 'Build personal, team agents, integrate company agents', link: '/agent' },
85+
] : [
6086
{ title: '安装指南', description: '快速在您的环境中设置 AutoDev', link: '/quick-start' },
6187
{ title: 'AI 程序员', description: '探索 AutoDev Sketch 自动编码', link: '/composer' },
6288
{ title: '定制化', description: '学习如何根据您的特定需求自定义 AutoDev', link: '/customize' },
@@ -67,8 +93,8 @@ function QuickLinks() {
6793
<section className={styles.quickLinks}>
6894
<div className="container">
6995
<div className="text--center margin-bottom--xl">
70-
<Heading as="h2">快速开始</Heading>
71-
<p>探索我们的文档,了解更多关于 AutoDev 的信息</p>
96+
<Heading as="h2">{isEnglish ? 'Quick Start' : '快速开始'}</Heading>
97+
<p>{isEnglish ? 'Explore our documentation to learn more about AutoDev' : '探索我们的文档,了解更多关于 AutoDev 的信息'}</p>
7298
</div>
7399
<div className="row">
74100
{links.map((item, idx) => (
@@ -87,82 +113,85 @@ function QuickLinks() {
87113
}
88114

89115
function ComparisonTable() {
116+
const { i18n: { currentLocale } } = useDocusaurusContext();
117+
const isEnglish = currentLocale === 'en';
118+
90119
return (
91120
<section className={styles.comparisonSection}>
92121
<div className="container">
93122
<div className="text--center margin-bottom--xl">
94-
<Heading as="h2">AutoDev 与传统 AI 编码助手的对比</Heading>
95-
<p>了解 AutoDev 如何从传统 AI 编码助手中脱颖而出</p>
123+
<Heading as="h2">{isEnglish ? 'AutoDev vs Traditional AI Coding Assistants' : 'AutoDev 与传统 AI 编码助手的对比'}</Heading>
124+
<p>{isEnglish ? 'Learn how AutoDev stands out from traditional AI coding assistants' : '了解 AutoDev 如何从传统 AI 编码助手中脱颖而出'}</p>
96125
</div>
97126
<div className={styles.tableWrapper}>
98127
<table className={styles.comparisonTable}>
99128
<thead>
100129
<tr>
101-
<th className={styles.featureCell}>功能</th>
102-
<th>传统 AI 助手</th>
130+
<th className={styles.featureCell}>{isEnglish ? 'Feature' : '功能'}</th>
131+
<th>{isEnglish ? 'Traditional AI Assistants' : '传统 AI 助手'}</th>
103132
<th className={styles.advantageCell}>AutoDev</th>
104133
</tr>
105134
</thead>
106135
<tbody>
107136
<tr>
108-
<td className={styles.featureCell}>主要功能</td>
109-
<td>代码建议和补全</td>
110-
<td className={styles.advantageCell}>自主规划和执行复杂开发任务</td>
137+
<td className={styles.featureCell}>{isEnglish ? 'Main Function' : '主要功能'}</td>
138+
<td>{isEnglish ? 'Code suggestions and completions' : '代码建议和补全'}</td>
139+
<td className={styles.advantageCell}>{isEnglish ? 'Autonomous planning and execution of complex development tasks' : '自主规划和执行复杂开发任务'}</td>
111140
</tr>
112141
<tr>
113-
<td className={styles.featureCell}>代码修改</td>
114-
<td>建议代码片段</td>
115-
<td className={styles.advantageCell}>自主编辑、重构和改进现有代码</td>
142+
<td className={styles.featureCell}>{isEnglish ? 'Code Modification' : '代码修改'}</td>
143+
<td>{isEnglish ? 'Suggest code snippets' : '建议代码片段'}</td>
144+
<td className={styles.advantageCell}>{isEnglish ? 'Autonomously edit, refactor, and improve existing code' : '自主编辑、重构和改进现有代码'}</td>
116145
</tr>
117146
<tr>
118-
<td className={styles.featureCell}>构建与执行</td>
147+
<td className={styles.featureCell}>{isEnglish ? 'Build & Execute' : '构建与执行'}</td>
119148
<td>
120149
<div className={styles.disadvantage}>
121150
<span className={styles.xIcon}></span>
122-
<span>有限或无</span>
151+
<span>{isEnglish ? 'Limited or none' : '有限或无'}</span>
123152
</div>
124153
</td>
125154
<td className={styles.advantageCell}>
126155
<div className={styles.advantage}>
127156
<span className={styles.checkIcon}></span>
128-
<span>在安全环境中构建和执行代码</span>
157+
<span>{isEnglish ? 'Build and execute code in a safe environment' : '在安全环境中构建和执行代码'}</span>
129158
</div>
130159
</td>
131160
</tr>
132161
<tr>
133-
<td className={styles.featureCell}>测试</td>
162+
<td className={styles.featureCell}>{isEnglish ? 'Testing' : '测试'}</td>
134163
<td>
135164
<div className={styles.disadvantage}>
136165
<span className={styles.xIcon}></span>
137-
<span>有限的测试生成</span>
166+
<span>{isEnglish ? 'Limited test generation' : '有限的测试生成'}</span>
138167
</div>
139168
</td>
140169
<td className={styles.advantageCell}>
141170
<div className={styles.advantage}>
142171
<span className={styles.checkIcon}></span>
143-
<span>创建并运行全面的测试</span>
172+
<span>{isEnglish ? 'Create and run comprehensive tests' : '创建并运行全面的测试'}</span>
144173
</div>
145174
</td>
146175
</tr>
147176
<tr>
148-
<td className={styles.featureCell}>Git 操作</td>
177+
<td className={styles.featureCell}>{isEnglish ? 'Git Operations' : 'Git 操作'}</td>
149178
<td>
150179
<div className={styles.disadvantage}>
151180
<span className={styles.xIcon}></span>
152-
<span></span>
181+
<span>{isEnglish ? 'None' : '无'}</span>
153182
</div>
154183
</td>
155184
<td className={styles.advantageCell}>
156185
<div className={styles.advantage}>
157186
<span className={styles.checkIcon}></span>
158-
<span>管理分支、提交和 PR</span>
187+
<span>{isEnglish ? 'Manage branches, commits, and PRs' : '管理分支、提交和 PR'}</span>
159188
</div>
160189
</td>
161190
</tr>
162191
<tr>
163-
<td className={styles.featureCell}>工作流复杂性</td>
164-
<td>简单、孤立的任务</td>
165-
<td className={styles.advantageCell}>端到端复杂开发工作流</td>
192+
<td className={styles.featureCell}>{isEnglish ? 'Workflow Complexity' : '工作流复杂性'}</td>
193+
<td>{isEnglish ? 'Simple, isolated tasks' : '简单、孤立的任务'}</td>
194+
<td className={styles.advantageCell}>{isEnglish ? 'End-to-end complex development workflows' : '端到端复杂开发工作流'}</td>
166195
</tr>
167196
</tbody>
168197
</table>
@@ -174,8 +203,15 @@ function ComparisonTable() {
174203

175204
// Community section
176205
function Community() {
177-
const resources = [
178-
{ title: 'GitHub', description: '为我们的仓库加星标,报告问题,并为代码库做出贡献', link: 'https://github.com/username/autodev', icon: <div className={styles.communityIconGithub} /> },
206+
const { i18n: { currentLocale } } = useDocusaurusContext();
207+
const isEnglish = currentLocale === 'en';
208+
209+
const resources = isEnglish ? [
210+
{ title: 'GitHub', description: 'Star our repository, report issues, and contribute to the codebase', link: 'https://github.com/unit-mesh/auto-dev', icon: <div className={styles.communityIconGithub} /> },
211+
{ title: 'Research Paper', description: 'Read our academic paper on arXiv to learn about the research behind AutoDev', link: '', icon: <div className={styles.communityIconPaper} /> },
212+
{ title: 'WeChat Group', description: 'Join our WeChat community to connect with other developers and get support (Add phodal02 as friend, note: AutoDev)', link: '', icon: <div className={styles.communityIconDiscord} /> },
213+
] : [
214+
{ title: 'GitHub', description: '为我们的仓库加星标,报告问题,并为代码库做出贡献', link: 'https://github.com/unit-mesh/auto-dev', icon: <div className={styles.communityIconGithub} /> },
179215
{ title: '研究论文', description: '阅读我们在 arXiv 上的学术论文,了解 AutoDev 背后的研究', link: '', icon: <div className={styles.communityIconPaper} /> },
180216
{ title: '微信群', description: '加入我们的 Wechat 社区,与其他开发者交流并获取支持(添加 phodal02 为好友,注明:AutoDev)', link: '', icon: <div className={styles.communityIconDiscord} /> },
181217
];
@@ -184,8 +220,8 @@ function Community() {
184220
<section className={styles.communitySection}>
185221
<div className="container">
186222
<div className="text--center margin-bottom--xl">
187-
<Heading as="h2">加入我们的社区</Heading>
188-
<p>与其他开发者联系并为 AutoDev 做出贡献</p>
223+
<Heading as="h2">{isEnglish ? 'Join Our Community' : '加入我们的社区'}</Heading>
224+
<p>{isEnglish ? 'Connect with other developers and contribute to AutoDev' : '与其他开发者联系并为 AutoDev 做出贡献'}</p>
189225
</div>
190226
<div className="row">
191227
{resources.map((item, idx) => (
@@ -204,12 +240,14 @@ function Community() {
204240
}
205241

206242
export default function HomepageFeatures(): ReactNode {
243+
const featureList = useFeatureList();
244+
207245
return (
208246
<>
209247
<section className={styles.features}>
210248
<div className="container">
211249
<div className="row">
212-
{FeatureList.map((props, idx) => (
250+
{featureList.map((props, idx) => (
213251
<Feature key={idx} {...props} />
214252
))}
215253
</div>

src/pages/index.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import Heading from "@theme/Heading"
99
import styles from "./index.module.css"
1010

1111
function HomepageHeader() {
12-
const { siteConfig } = useDocusaurusContext()
12+
const { siteConfig, i18n: { currentLocale } } = useDocusaurusContext()
13+
const isEnglish = currentLocale === 'en'
14+
1315
return (
1416
<header className={clsx("hero hero--primary", styles.heroBanner)}>
1517
<div className="container">
@@ -19,10 +21,10 @@ function HomepageHeader() {
1921
<p className="hero__subtitle">{siteConfig.tagline}</p>
2022
<div className={styles.buttons}>
2123
<Link className="button button--secondary button--lg" to="/intro">
22-
快速开始
24+
{isEnglish ? "Quick Start" : "快速开始"}
2325
</Link>
2426
<Link className="button button--outline button--lg button--secondary font-white" to="/features">
25-
探索能力
27+
{isEnglish ? "Explore Features" : "探索能力"}
2628
</Link>
2729
</div>
2830
</div>

0 commit comments

Comments
 (0)