-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLanguageContext.tsx
More file actions
executable file
·273 lines (264 loc) · 7.88 KB
/
LanguageContext.tsx
File metadata and controls
executable file
·273 lines (264 loc) · 7.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
import React, { createContext, useContext, useState, ReactNode } from 'react';
type Language = 'en' | 'zh';
interface Translations {
nav: {
startCoding: string;
github: string;
};
hero: {
slogan: string;
title: ReactNode;
ifYou: string;
ifList: string[];
subtitle: string;
description: string;
philosophy: string[];
ctaStart: string;
ctaGithub: string;
};
stack: {
header: string;
subtitle: string;
items: {
title: string;
desc: string;
}[];
};
workflow: {
header: string;
subtitle: string;
steps: {
title: string;
desc: string;
}[];
};
production: {
header: string;
subtitle: string;
items: {
title: string;
desc: string;
}[];
};
howItWorks: {
header: string;
title: string;
desc: string;
};
footer: {
rights: string;
startNow: string;
};
}
const translations: Record<Language, Translations> = {
en: {
nav: {
startCoding: "[ Start_Coding ]",
github: "[ GitHub ]"
},
hero: {
slogan: "> VIBE CODING_",
title: "The Cloud Development Platform for Purists.",
ifYou: "IF (YOU):",
ifList: [
"> Live in the terminal",
"> Crave minimalism",
"> Hate Deploy"
],
subtitle: "Fulling is the AI-native full-stack platform built for shipping.",
description: "We provide a production-grade environment with Claude Code, PostgreSQL, Next.js, and shadcn/ui pre-wired.",
philosophy: [
"Terminal is all you need",
"Production-grade architecture",
"Full-stack focus"
],
ctaStart: "[ Start_Coding ]",
ctaGithub: "[ GitHub ]"
},
stack: {
header: "## THE_GOLDEN_STACK",
subtitle: "Zero Config. 100% Modern. Powered by SOTA AI.",
items: [
{
title: "Claude Opus / Kimi k2-thinking",
desc: "Intelligence at the core. Switch models effortlessly. No manual configuration required."
},
{
title: "Next.js",
desc: "The React Framework for the web. Handles your frontend and API routes seamlessly."
},
{
title: "PostgreSQL",
desc: "A fully managed, feature-complete SQL database. You own the data; we manage the ops."
},
{
title: "shadcn/ui",
desc: "Beautifully designed, composable components. Copy, paste, and ship accessible UI."
},
{
title: "Sealos",
desc: "The underlying operating system. From first line of code to production deployment instantly."
}
]
},
workflow: {
header: "## EXECUTION_PLAN",
subtitle: "From init to production in three steps.",
steps: [
{
title: "Initiate",
desc: "AI bootstraps your entire environment: Next.js app, shadcn/ui library, and PostgreSQL instance are ready in seconds."
},
{
title: "Code",
desc: "Collaborate with AI directly inside the web terminal. Build, debug, and refactor without context switching."
},
{
title: "Ship",
desc: "Instant deployment. Your app gets a global, public-facing URL automatically."
}
]
},
production: {
header: "## BEYOND_LOCALHOST",
subtitle: "Not just a playground. We build for the real world.",
items: [
{
title: "[ Automated Authentication ]",
desc: "Stop fighting with passport or next-auth. Full integration with Google, GitHub, and Email login is standard."
},
{
title: "[ One-Click Payments ]",
desc: "Monetize instantly. Seamless integration with Stripe and PayPal."
}
]
},
howItWorks: {
header: "## UNDER_THE_HOOD",
title: "How Fulling Works:",
desc: "We provision a dedicated development environment and database on Sealos for every project. Your sandbox mounts a stateful working directory—ensuring your code is safe, persistent, and always accessible via a public domain."
},
footer: {
rights: "© 2024 FullStackAgent. Built for Geeks.",
startNow: "Start Now"
}
},
zh: {
nav: {
startCoding: "[ 快速开始 ]",
github: "[ GitHub ]"
},
hero: {
slogan: "> VIBE CODING_",
title: <>专为极客打造的 <br /> vibe coding 云开发平台</>,
ifYou: "如果你:",
ifList: [
"> 热爱终端",
"> 喜欢极简风",
"> 不需要部署"
],
subtitle: "Fulling 是一个专为构建生产级别 Web 应用而设计的 AI 全栈编码平台。",
description: "内置 claude code/pgsql/next.js/shadcn 开箱即用,自动处理鉴权与支付。",
philosophy: [
"terminal is all you need",
"为生产级别业务打造",
"聚焦全栈开发场景"
],
ctaStart: "[ 快速开始 ]",
ctaGithub: "[ GitHub ]"
},
stack: {
header: "## 核心技术栈",
subtitle: "无需配置。我们为您准备好了一切,由最先进的 AI 驱动。",
items: [
{
title: "Claude Opus/Kimi k2-thinking 模型",
desc: "强力驱动的 AI 模型驱动,无需人工配置,自由切换。"
},
{
title: "Next.js",
desc: "业界领先的全栈框架,负责前端与 API。"
},
{
title: "PostgreSQL",
desc: "您无需管理的、功能完备的 SQL 数据库。"
},
{
title: "shadcn/ui",
desc: "优雅、可组合的 UI 组件库,开箱即用。"
},
{
title: "Sealos",
desc: "代码编写完直接 Production 级别提供在线服务。"
}
]
},
workflow: {
header: "## 极简工作流",
subtitle: "三步,从灵感到上线",
steps: [
{
title: "启动 (Initiate)",
desc: "AI 将自动初始化 Next.js + PGSQL + shadcn/ui 的环境构建和 pgsql 数据库。"
},
{
title: "编码 (Code)",
desc: "在 web 终端内与 AI 协作,完成所有编码、调试和重构。"
},
{
title: "上线 (Deploy)",
desc: "自动提供一个全球可访问的域名地址。"
}
]
},
production: {
header: "## 专为生产环境设计",
subtitle: "不止是 Demo,我们为生产环境而生",
items: [
{
title: "自动鉴权 (Automated Authentication)",
desc: "告别繁琐的 passport 或 next-auth 配置。集成 Google, GitHub 或邮箱登录。"
},
{
title: "一键支付 (One-Click Payments)",
desc: "轻松对接 Stripe 或 paypal。"
}
]
},
howItWorks: {
header: "## 工作原理",
title: "Fulling 工作原理:",
desc: "Fulling 为每个项目在 Sealos 上创建开发环境和数据库,并提供一个公网可以访问的域名,开发沙箱挂载一个有状态的工作目录,保证代码不丢失。"
},
footer: {
rights: "© 2024 FullStackAgent. Built for Geeks.",
startNow: "立即开始"
}
}
};
interface LanguageContextType {
language: Language;
setLanguage: (lang: Language) => void;
t: Translations;
}
const LanguageContext = createContext<LanguageContextType | undefined>(undefined);
export const LanguageProvider: React.FC<{ children: ReactNode }> = ({ children }) => {
const [language, setLanguage] = useState<Language>('en');
const value = {
language,
setLanguage,
t: translations[language]
};
return (
<LanguageContext.Provider value={value}>
{children}
</LanguageContext.Provider>
);
};
export const useLanguage = () => {
const context = useContext(LanguageContext);
if (context === undefined) {
throw new Error('useLanguage must be used within a LanguageProvider');
}
return context;
};