Skip to content

Commit ca0e6dd

Browse files
authored
Merge pull request #31 from objectstack-ai/copilot/add-international-homepage
2 parents 2298e72 + 716b5e9 commit ca0e6dd

File tree

4 files changed

+275
-58
lines changed

4 files changed

+275
-58
lines changed

apps/docs/app/[lang]/page.tsx

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@ import Link from 'next/link';
22
import { Database, FileJson, Layers, ShieldCheck, Zap, Globe, Cpu, LayoutTemplate, Bot } from 'lucide-react';
33
import { HomeLayout } from 'fumadocs-ui/layouts/home';
44
import { baseOptions } from '@/app/layout.config';
5+
import { getHomepageTranslations } from '@/lib/homepage-i18n';
6+
7+
export default async function HomePage({
8+
params,
9+
}: {
10+
params: Promise<{ lang: string }>;
11+
}) {
12+
const { lang } = await params;
13+
const t = getHomepageTranslations(lang);
514

6-
export default function HomePage() {
715
return (
816
<HomeLayout {...baseOptions} i18n>
917
<main className="flex min-h-screen flex-col items-center justify-center text-center px-4 py-16 sm:py-24 md:py-32 overflow-hidden bg-background text-foreground selection:bg-primary/20">
@@ -12,31 +20,31 @@ export default function HomePage() {
1220
<div className="relative z-10 max-w-5xl space-y-8">
1321
<div className="inline-flex items-center rounded-full border border-fd-primary/20 bg-fd-primary/5 px-3 py-1 text-sm text-fd-primary backdrop-blur-sm transition-colors hover:bg-fd-primary/10 hover:border-fd-primary/30">
1422
<span className="flex h-2 w-2 rounded-full bg-fd-primary mr-2 animate-pulse"></span>
15-
Protocol Specification v1.0
23+
{t.badge.status} {t.badge.version}
1624
</div>
1725

1826
<h1 className="text-5xl font-extrabold tracking-tight sm:text-7xl md:text-8xl bg-gradient-to-br from-foreground via-foreground/90 to-fd-primary/60 bg-clip-text text-transparent pb-4">
19-
The ObjectStack <br/> Protocol
27+
{t.hero.title.line1} <br/> {t.hero.title.line2}
2028
</h1>
2129

2230
<p className="mx-auto max-w-2xl text-lg text-fd-muted-foreground sm:text-xl leading-relaxed">
23-
The Open Standard for Metadata-Driven Enterprise Software.
31+
{t.hero.subtitle.line1}
2432
<br className="hidden sm:inline" />
25-
<span className="text-fd-foreground font-medium">Validatable. Database-Agnostic. AI-Native.</span>
33+
<span className="text-fd-foreground font-medium">{t.hero.subtitle.line2}</span>
2634
</p>
2735

2836
<div className="flex flex-col sm:flex-row items-center justify-center gap-4 pt-4">
2937
<Link
3038
href="/docs/guides/getting-started"
3139
className="inline-flex h-12 items-center justify-center rounded-lg bg-fd-primary px-8 text-sm font-medium text-fd-primary-foreground shadow-lg shadow-fd-primary/20 transition-all hover:bg-fd-primary/90 hover:scale-105 hover:shadow-fd-primary/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fd-ring disabled:pointer-events-none disabled:opacity-50"
3240
>
33-
Start Building
41+
{t.hero.cta.primary}
3442
</Link>
3543
<Link
3644
href="/docs"
3745
className="inline-flex h-12 items-center justify-center rounded-lg border border-fd-border bg-fd-card/50 px-8 text-sm font-medium shadow-sm transition-all hover:bg-fd-accent hover:text-fd-accent-foreground backdrop-blur-sm hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fd-ring disabled:pointer-events-none disabled:opacity-50"
3846
>
39-
Read Specification
47+
{t.hero.cta.secondary}
4048
</Link>
4149
</div>
4250

@@ -48,7 +56,7 @@ export default function HomePage() {
4856
<div className="h-3 w-3 rounded-full bg-yellow-500/80" />
4957
<div className="h-3 w-3 rounded-full bg-green-500/80" />
5058
<div className="ml-2 text-xs font-medium text-fd-muted-foreground font-mono">
51-
contract.zod.ts
59+
{t.codePreview.filename}
5260
</div>
5361
</div>
5462
<div className="overflow-x-auto p-6 text-left">
@@ -78,68 +86,68 @@ export default function HomePage() {
7886
<div className="mt-24 grid grid-cols-1 gap-8 text-left sm:grid-cols-2 lg:grid-cols-3 max-w-6xl w-full">
7987
<FeatureCard
8088
icon={<Database className="h-6 w-6" />}
81-
title="ObjectQL Data Layer"
89+
title={t.features.objectql.title}
8290
href="/docs/specifications/data/architecture"
83-
description="Strict JSON schemas for entities, fields, and relationships. It is the SQL you can send over the wire."
91+
description={t.features.objectql.description}
8492
/>
8593
<FeatureCard
8694
icon={<Layers className="h-6 w-6" />}
87-
title="ObjectUI View Layer"
95+
title={t.features.objectui.title}
8896
href="/docs/specifications/ui/sdui-protocol"
89-
description="Server-Driven UI protocol defining forms, grids, and dashboards. Decouples logic from the frontend implementation."
97+
description={t.features.objectui.description}
9098
/>
9199
<FeatureCard
92100
icon={<Zap className="h-6 w-6" />}
93-
title="ObjectOS Kernel"
101+
title={t.features.objectos.title}
94102
href="/docs/specifications/server/kernel-architecture"
95-
description="The runtime contract for permissions, workflows, and automation. Stateless business logic execution."
103+
description={t.features.objectos.description}
96104
/>
97105
<FeatureCard
98106
icon={<ShieldCheck className="h-6 w-6" />}
99-
title="Zero-Trust Security"
107+
title={t.features.security.title}
100108
href="/docs/specifications/server/permission-governance"
101-
description="Policy-as-Code. ACLs and Field Level Security are compiled into the database query engine."
109+
description={t.features.security.description}
102110
/>
103111
<FeatureCard
104112
icon={<FileJson className="h-6 w-6" />}
105-
title="Zod-First Definition"
113+
title={t.features.zodFirst.title}
106114
href="/docs/specifications/data/schema-definition"
107-
description="The entire protocol is defined in Zod. Runtime validation and static type inference come for free."
115+
description={t.features.zodFirst.description}
108116
/>
109117
<FeatureCard
110118
icon={<Globe className="h-6 w-6" />}
111-
title="Universal Backend"
119+
title={t.features.universal.title}
112120
href="/docs/concepts/architecture"
113-
description="Protocol adapters for Postgres, MongoDB, REST and GraphQL. Write once, run on any infrastructure."
121+
description={t.features.universal.description}
114122
/>
115123
</div>
116124

117125
{/* Personas Section */}
118126
<div className="mt-32 mb-16 w-full max-w-5xl px-4">
119127
<h2 className="text-3xl font-bold tracking-tight mb-12 bg-gradient-to-r from-fd-foreground to-fd-muted-foreground bg-clip-text text-transparent">
120-
Built for Builders
128+
{t.personas.heading}
121129
</h2>
122130
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
123131
<PersonaCard
124132
icon={<LayoutTemplate className="w-8 h-8 mb-4 text-blue-500" />}
125-
title="Platform Architects"
126-
description="Design scalable Internal Developer Platforms (IDP) that unify your data silos."
133+
title={t.personas.architect.title}
134+
description={t.personas.architect.description}
127135
href="/docs/concepts/enterprise-patterns"
128-
action="Explore Patterns"
136+
action={t.personas.architect.action}
129137
/>
130138
<PersonaCard
131139
icon={<Bot className="w-8 h-8 mb-4 text-purple-500" />}
132-
title="AI Engineers"
133-
description="Feed LLMs with perfectly structured, deterministic JSON schemas they can actually understand."
140+
title={t.personas.aiEngineer.title}
141+
description={t.personas.aiEngineer.description}
134142
href="/docs/concepts/ai-codex"
135-
action="View Codex"
143+
action={t.personas.aiEngineer.action}
136144
/>
137145
<PersonaCard
138146
icon={<Cpu className="w-8 h-8 mb-4 text-green-500" />}
139-
title="Framework Builders"
140-
description="Implement the protocol in your language. Write drivers for React, Vue, Flutter, or Go."
147+
title={t.personas.frameworkBuilder.title}
148+
description={t.personas.frameworkBuilder.description}
141149
href="/docs/specifications/data/architecture"
142-
action="Read Spec"
150+
action={t.personas.frameworkBuilder.action}
143151
/>
144152
</div>
145153
</div>

apps/docs/lib/homepage-i18n.ts

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
/**
2+
* Homepage Internationalization
3+
*
4+
* Translations for the ObjectStack homepage
5+
* Supports: en (English), cn (Chinese/中文)
6+
*/
7+
8+
export interface HomepageTranslations {
9+
// Hero Section
10+
badge: {
11+
status: string;
12+
version: string;
13+
};
14+
hero: {
15+
title: {
16+
line1: string;
17+
line2: string;
18+
};
19+
subtitle: {
20+
line1: string;
21+
line2: string;
22+
};
23+
cta: {
24+
primary: string;
25+
secondary: string;
26+
};
27+
};
28+
29+
// Code Preview
30+
codePreview: {
31+
filename: string;
32+
};
33+
34+
// Features Section
35+
features: {
36+
objectql: {
37+
title: string;
38+
description: string;
39+
};
40+
objectui: {
41+
title: string;
42+
description: string;
43+
};
44+
objectos: {
45+
title: string;
46+
description: string;
47+
};
48+
security: {
49+
title: string;
50+
description: string;
51+
};
52+
zodFirst: {
53+
title: string;
54+
description: string;
55+
};
56+
universal: {
57+
title: string;
58+
description: string;
59+
};
60+
};
61+
62+
// Personas Section
63+
personas: {
64+
heading: string;
65+
architect: {
66+
title: string;
67+
description: string;
68+
action: string;
69+
};
70+
aiEngineer: {
71+
title: string;
72+
description: string;
73+
action: string;
74+
};
75+
frameworkBuilder: {
76+
title: string;
77+
description: string;
78+
action: string;
79+
};
80+
};
81+
}
82+
83+
/**
84+
* English Translations
85+
*/
86+
export const en: HomepageTranslations = {
87+
badge: {
88+
status: 'Protocol Specification',
89+
version: 'v1.0',
90+
},
91+
hero: {
92+
title: {
93+
line1: 'The ObjectStack',
94+
line2: 'Protocol',
95+
},
96+
subtitle: {
97+
line1: 'The Open Standard for Metadata-Driven Enterprise Software.',
98+
line2: 'Validatable. Database-Agnostic. AI-Native.',
99+
},
100+
cta: {
101+
primary: 'Start Building',
102+
secondary: 'Read Specification',
103+
},
104+
},
105+
codePreview: {
106+
filename: 'contract.zod.ts',
107+
},
108+
features: {
109+
objectql: {
110+
title: 'ObjectQL Data Layer',
111+
description: 'Strict JSON schemas for entities, fields, and relationships. It is the SQL you can send over the wire.',
112+
},
113+
objectui: {
114+
title: 'ObjectUI View Layer',
115+
description: 'Server-Driven UI protocol defining forms, grids, and dashboards. Decouples logic from the frontend implementation.',
116+
},
117+
objectos: {
118+
title: 'ObjectOS Kernel',
119+
description: 'The runtime contract for permissions, workflows, and automation. Stateless business logic execution.',
120+
},
121+
security: {
122+
title: 'Zero-Trust Security',
123+
description: 'Policy-as-Code. ACLs and Field Level Security are compiled into the database query engine.',
124+
},
125+
zodFirst: {
126+
title: 'Zod-First Definition',
127+
description: 'The entire protocol is defined in Zod. Runtime validation and static type inference come for free.',
128+
},
129+
universal: {
130+
title: 'Universal Backend',
131+
description: 'Protocol adapters for Postgres, MongoDB, REST and GraphQL. Write once, run on any infrastructure.',
132+
},
133+
},
134+
personas: {
135+
heading: 'Built for Builders',
136+
architect: {
137+
title: 'Platform Architects',
138+
description: 'Design scalable Internal Developer Platforms (IDP) that unify your data silos.',
139+
action: 'Explore Patterns',
140+
},
141+
aiEngineer: {
142+
title: 'AI Engineers',
143+
description: 'Feed LLMs with perfectly structured, deterministic JSON schemas they can actually understand.',
144+
action: 'View Codex',
145+
},
146+
frameworkBuilder: {
147+
title: 'Framework Builders',
148+
description: 'Implement the protocol in your language. Write drivers for React, Vue, Flutter, or Go.',
149+
action: 'Read Spec',
150+
},
151+
},
152+
};
153+
154+
/**
155+
* Chinese Translations (中文翻译)
156+
*/
157+
export const cn: HomepageTranslations = {
158+
badge: {
159+
status: '协议规范',
160+
version: 'v1.0',
161+
},
162+
hero: {
163+
title: {
164+
line1: 'ObjectStack',
165+
line2: '协议',
166+
},
167+
subtitle: {
168+
line1: '元数据驱动企业软件的开放标准。',
169+
line2: '可验证。数据库无关。AI 原生。',
170+
},
171+
cta: {
172+
primary: '开始构建',
173+
secondary: '阅读规范',
174+
},
175+
},
176+
codePreview: {
177+
filename: 'contract.zod.ts',
178+
},
179+
features: {
180+
objectql: {
181+
title: 'ObjectQL 数据层',
182+
description: '严格的 JSON 模式定义实体、字段和关系。这是可以在网络上传输的 SQL。',
183+
},
184+
objectui: {
185+
title: 'ObjectUI 视图层',
186+
description: '定义表单、网格和仪表板的服务器驱动 UI 协议。将逻辑与前端实现解耦。',
187+
},
188+
objectos: {
189+
title: 'ObjectOS 内核',
190+
description: '权限、工作流和自动化的运行时契约。无状态业务逻辑执行。',
191+
},
192+
security: {
193+
title: '零信任安全',
194+
description: '策略即代码。ACL 和字段级安全被编译到数据库查询引擎中。',
195+
},
196+
zodFirst: {
197+
title: 'Zod 优先定义',
198+
description: '整个协议都用 Zod 定义。运行时验证和静态类型推断免费获得。',
199+
},
200+
universal: {
201+
title: '通用后端',
202+
description: 'Postgres、MongoDB、REST 和 GraphQL 的协议适配器。一次编写,在任何基础设施上运行。',
203+
},
204+
},
205+
personas: {
206+
heading: '为构建者而建',
207+
architect: {
208+
title: '平台架构师',
209+
description: '设计可扩展的内部开发者平台(IDP),统一你的数据孤岛。',
210+
action: '探索模式',
211+
},
212+
aiEngineer: {
213+
title: 'AI 工程师',
214+
description: '为 LLM 提供结构完美、确定性强的 JSON 模式,让它们能够真正理解。',
215+
action: '查看代码库',
216+
},
217+
frameworkBuilder: {
218+
title: '框架构建者',
219+
description: '用你的语言实现协议。为 React、Vue、Flutter 或 Go 编写驱动程序。',
220+
action: '阅读规范',
221+
},
222+
},
223+
};
224+
225+
/**
226+
* Get translations for a specific language
227+
*/
228+
export function getHomepageTranslations(lang: string): HomepageTranslations {
229+
switch (lang) {
230+
case 'cn':
231+
return cn;
232+
case 'en':
233+
default:
234+
return en;
235+
}
236+
}

0 commit comments

Comments
 (0)