Skip to content

Commit 4d8b402

Browse files
committed
feat(Internationalization): translate user-facing text to English across multiple components
1 parent 3d7f5c5 commit 4d8b402

File tree

8 files changed

+61
-61
lines changed

8 files changed

+61
-61
lines changed

apps/console/src/App.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ function RecordDetailView({ dataSource, objects, onEdit }: any) {
3131
return (
3232
<div className="flex h-full items-center justify-center p-4">
3333
<Empty>
34-
<EmptyTitle>对象未找到</EmptyTitle>
35-
<p>对象 "{objectName}" 定义缺失。</p>
34+
<EmptyTitle>Object Not Found</EmptyTitle>
35+
<p>Object "{objectName}" definition missing.</p>
3636
</Empty>
3737
</div>
3838
);
@@ -66,7 +66,7 @@ function RecordDetailView({ dataSource, objects, onEdit }: any) {
6666
variant="outline"
6767
size="icon"
6868
onClick={() => setShowDebug(!showDebug)}
69-
title="切换元数据检查器"
69+
title="Toggle Metadata Inspector"
7070
className="bg-background/80 backdrop-blur shadow-sm"
7171
>
7272
<Code2 className="h-4 w-4" />
@@ -84,12 +84,12 @@ function RecordDetailView({ dataSource, objects, onEdit }: any) {
8484
{showDebug && (
8585
<div className="w-[400px] border-l bg-muted/30 p-0 overflow-hidden flex flex-col shrink-0 shadow-xl z-20 transition-all">
8686
<div className="p-3 border-b bg-muted/50 font-semibold text-sm flex items-center justify-between">
87-
<span>元数据检查器</span>
88-
<span className="text-xs text-muted-foreground">JSON 协议</span>
87+
<span>Metadata Inspector</span>
88+
<span className="text-xs text-muted-foreground">JSON Protocol</span>
8989
</div>
9090
<div className="flex-1 overflow-auto p-4 space-y-6">
9191
<div>
92-
<h4 className="text-xs font-bold uppercase text-muted-foreground mb-2">视图配置</h4>
92+
<h4 className="text-xs font-bold uppercase text-muted-foreground mb-2">View Schema</h4>
9393
<div className="relative rounded-md border bg-slate-950 text-slate-50 overflow-hidden">
9494
<pre className="text-xs p-3 overflow-auto max-h-[800px]">
9595
{JSON.stringify(detailSchema, null, 2)}
@@ -203,7 +203,7 @@ export function AppContent() {
203203
if (!activeApp) return (
204204
<div className="h-screen flex items-center justify-center">
205205
<Empty>
206-
<EmptyTitle>未配置应用</EmptyTitle>
206+
<EmptyTitle>No Apps Configured</EmptyTitle>
207207
</Empty>
208208
</div>
209209
);
@@ -261,9 +261,9 @@ export function AppContent() {
261261
<Dialog open={isDialogOpen} onOpenChange={setIsDialogOpen}>
262262
<DialogContent className="sm:max-w-xl max-h-[90vh] flex flex-col gap-0 p-0 overflow-hidden">
263263
<DialogHeader className="p-6 pb-4 border-b">
264-
<DialogTitle>{editingRecord ? '编辑' : '新建'} {currentObjectDef?.label}</DialogTitle>
264+
<DialogTitle>{editingRecord ? 'Edit' : 'Create'} {currentObjectDef?.label}</DialogTitle>
265265
<DialogDescription>
266-
{editingRecord ? `更新 ${currentObjectDef?.label} 的详细信息` : `添加一条新的 ${currentObjectDef?.label} 记录`}
266+
{editingRecord ? `Update details for ${currentObjectDef?.label}` : `Add a new ${currentObjectDef?.label} to your database.`}
267267
</DialogDescription>
268268
</DialogHeader>
269269
<div className="flex-1 overflow-y-auto p-6">
@@ -286,8 +286,8 @@ export function AppContent() {
286286
onCancel: () => setIsDialogOpen(false),
287287
showSubmit: true,
288288
showCancel: true,
289-
submitText: '保存记录',
290-
cancelText: '取消'
289+
submitText: 'Save Record',
290+
cancelText: 'Cancel'
291291
}}
292292
dataSource={dataSource}
293293
/>

apps/console/src/components/AppSidebar.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export function AppSidebar({ activeAppName, onAppChange }: { activeAppName: stri
9797
<div className="grid flex-1 text-left text-sm leading-tight">
9898
<span className="truncate font-semibold">{activeApp.label}</span>
9999
<span className="truncate text-xs">
100-
{activeApp.description || `${activeApps.length} 个应用`}
100+
{activeApp.description || `${activeApps.length} Apps Available`}
101101
</span>
102102
</div>
103103
<ChevronsUpDown className="ml-auto" />
@@ -110,7 +110,7 @@ export function AppSidebar({ activeAppName, onAppChange }: { activeAppName: stri
110110
sideOffset={4}
111111
>
112112
<DropdownMenuLabel className="text-xs text-muted-foreground">
113-
切换应用
113+
Switch Application
114114
</DropdownMenuLabel>
115115
{activeApps.map((app: any) => (
116116
<DropdownMenuItem
@@ -130,7 +130,7 @@ export function AppSidebar({ activeAppName, onAppChange }: { activeAppName: stri
130130
<div className="flex size-6 items-center justify-center rounded-md border bg-background">
131131
<Plus className="size-4" />
132132
</div>
133-
<div className="font-medium text-muted-foreground">添加应用</div>
133+
<div className="font-medium text-muted-foreground">Add App</div>
134134
</DropdownMenuItem>
135135
</DropdownMenuContent>
136136
</DropdownMenu>
@@ -152,11 +152,11 @@ export function AppSidebar({ activeAppName, onAppChange }: { activeAppName: stri
152152
className="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground"
153153
>
154154
<Avatar className="h-8 w-8 rounded-lg">
155-
<AvatarImage src="/avatars/user.jpg" alt="用户" />
156-
<AvatarFallback className="rounded-lg bg-primary text-primary-foreground"></AvatarFallback>
155+
<AvatarImage src="/avatars/user.jpg" alt="User" />
156+
<AvatarFallback className="rounded-lg bg-primary text-primary-foreground">JD</AvatarFallback>
157157
</Avatar>
158158
<div className="grid flex-1 text-left text-sm leading-tight">
159-
<span className="truncate font-semibold">管理员</span>
159+
<span className="truncate font-semibold">John Doe</span>
160160
<span className="truncate text-xs text-muted-foreground">admin@example.com</span>
161161
</div>
162162
<ChevronsUpDown className="ml-auto size-4" />
@@ -171,11 +171,11 @@ export function AppSidebar({ activeAppName, onAppChange }: { activeAppName: stri
171171
<DropdownMenuLabel className="p-0 font-normal">
172172
<div className="flex items-center gap-2 px-1 py-1.5 text-left text-sm">
173173
<Avatar className="h-8 w-8 rounded-lg">
174-
<AvatarImage src="/avatars/user.jpg" alt="用户" />
175-
<AvatarFallback className="rounded-lg bg-primary text-primary-foreground"></AvatarFallback>
174+
<AvatarImage src="/avatars/user.jpg" alt="User" />
175+
<AvatarFallback className="rounded-lg bg-primary text-primary-foreground">JD</AvatarFallback>
176176
</Avatar>
177177
<div className="grid flex-1 text-left text-sm leading-tight">
178-
<span className="truncate font-semibold">管理员</span>
178+
<span className="truncate font-semibold">John Doe</span>
179179
<span className="truncate text-xs text-muted-foreground">admin@example.com</span>
180180
</div>
181181
</div>
@@ -184,13 +184,13 @@ export function AppSidebar({ activeAppName, onAppChange }: { activeAppName: stri
184184
<DropdownMenuGroup>
185185
<DropdownMenuItem>
186186
<Settings className="mr-2 h-4 w-4" />
187-
设置
187+
Settings
188188
</DropdownMenuItem>
189189
</DropdownMenuGroup>
190190
<DropdownMenuSeparator />
191191
<DropdownMenuItem className="text-destructive focus:text-destructive">
192192
<LogOut className="mr-2 h-4 w-4" />
193-
退出登录
193+
Log out
194194
</DropdownMenuItem>
195195
</DropdownMenuContent>
196196
</DropdownMenu>

apps/console/src/components/DashboardView.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ export function DashboardView() {
2222
return (
2323
<div className="h-full flex items-center justify-center p-8">
2424
<Empty>
25-
<EmptyTitle>仪表盘未找到</EmptyTitle>
26-
<EmptyDescription>仪表盘 "{dashboardName}" 不存在。</EmptyDescription>
25+
<EmptyTitle>Dashboard Not Found</EmptyTitle>
26+
<EmptyDescription>The dashboard "{dashboardName}" could not be found.</EmptyDescription>
2727
</Empty>
2828
</div>
2929
);
@@ -45,7 +45,7 @@ export function DashboardView() {
4545
className="gap-2"
4646
>
4747
<Code2 className="h-4 w-4" />
48-
元数据
48+
Metadata
4949
</Button>
5050
</div>
5151

@@ -57,12 +57,12 @@ export function DashboardView() {
5757
{showDebug && (
5858
<div className="w-[400px] border-l bg-muted/30 p-0 overflow-hidden flex flex-col shrink-0 shadow-xl z-20 transition-all">
5959
<div className="p-3 border-b bg-muted/50 font-semibold text-sm flex items-center justify-between">
60-
<span>元数据检查器</span>
61-
<span className="text-xs text-muted-foreground">JSON 协议</span>
60+
<span>Metadata Inspector</span>
61+
<span className="text-xs text-muted-foreground">JSON Protocol</span>
6262
</div>
6363
<div className="flex-1 overflow-auto p-4 space-y-6">
6464
<div>
65-
<h4 className="text-xs font-bold uppercase text-muted-foreground mb-2">仪表盘配置</h4>
65+
<h4 className="text-xs font-bold uppercase text-muted-foreground mb-2">Dashboard Configuration</h4>
6666
<div className="relative rounded-md border bg-slate-950 text-slate-50 overflow-hidden">
6767
<pre className="text-xs p-3 overflow-auto max-h-[800px]">
6868
{JSON.stringify(dashboard, null, 2)}

apps/console/src/components/LoadingScreen.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ export function LoadingScreen() {
1717
{/* Title */}
1818
<div className="text-center space-y-2">
1919
<h1 className="text-2xl font-bold tracking-tight">ObjectStack Console</h1>
20-
<p className="text-sm text-muted-foreground">正在初始化应用程序...</p>
20+
<p className="text-sm text-muted-foreground">Initializing application...</p>
2121
</div>
2222

2323
{/* Loading indicator */}
2424
<div className="flex items-center gap-3 px-4 py-2 bg-muted/50 rounded-full">
2525
<Spinner className="h-4 w-4 text-primary" />
26-
<span className="text-sm text-muted-foreground">连接数据源</span>
26+
<span className="text-sm text-muted-foreground">Connecting to data source</span>
2727
</div>
2828
</div>
2929
</div>

apps/console/src/components/ObjectView.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export function ObjectView({ dataSource, objects, onEdit, onRowClick }: any) {
2424
return (
2525
<div className="h-full p-4 flex items-center justify-center">
2626
<Empty>
27-
<EmptyTitle>对象未找到</EmptyTitle>
28-
<EmptyDescription>对象 "{objectName}" 在当前配置中不存在。</EmptyDescription>
27+
<EmptyTitle>Object Not Found</EmptyTitle>
28+
<EmptyDescription>The object "{objectName}" does not exist in the current configuration.</EmptyDescription>
2929
</Empty>
3030
</div>
3131
);
@@ -44,7 +44,7 @@ export function ObjectView({ dataSource, objects, onEdit, onRowClick }: any) {
4444
if (viewList.length === 0) {
4545
viewList.push({
4646
id: 'all',
47-
label: '全部记录',
47+
label: 'All Records',
4848
type: 'grid',
4949
columns: objectDef.fields ? Object.keys(objectDef.fields).slice(0, 5) : []
5050
});
@@ -195,14 +195,14 @@ export function ObjectView({ dataSource, objects, onEdit, onRowClick }: any) {
195195
variant={showDebug ? "secondary" : "outline"}
196196
onClick={() => setShowDebug(!showDebug)}
197197
className="shadow-none gap-2 hidden sm:flex"
198-
title="切换元数据检查器"
198+
title="Toggle Metadata Inspector"
199199
>
200200
<Code2 className="h-4 w-4" />
201-
<span className="hidden lg:inline">元数据</span>
201+
<span className="hidden lg:inline">Metadata</span>
202202
</Button>
203203
<Button size="sm" onClick={() => onEdit(null)} className="shadow-none gap-2">
204204
<Plus className="h-4 w-4" />
205-
<span className="hidden sm:inline">新建</span>
205+
<span className="hidden sm:inline">New</span>
206206
</Button>
207207
</div>
208208
</div>
@@ -251,12 +251,12 @@ export function ObjectView({ dataSource, objects, onEdit, onRowClick }: any) {
251251
{showDebug && (
252252
<div className="w-[400px] border-l bg-muted/30 p-0 overflow-hidden flex flex-col shrink-0 shadow-xl z-20 transition-all">
253253
<div className="p-3 border-b bg-muted/50 font-semibold text-sm flex items-center justify-between">
254-
<span>元数据检查器</span>
255-
<span className="text-xs text-muted-foreground">JSON 协议</span>
254+
<span>Metadata Inspector</span>
255+
<span className="text-xs text-muted-foreground">JSON Protocol</span>
256256
</div>
257257
<div className="flex-1 overflow-auto p-4 space-y-6">
258258
<div>
259-
<h4 className="text-xs font-bold uppercase text-muted-foreground mb-2">视图配置</h4>
259+
<h4 className="text-xs font-bold uppercase text-muted-foreground mb-2">View Configuration</h4>
260260
<div className="relative rounded-md border bg-slate-950 text-slate-50 overflow-hidden">
261261
<pre className="text-xs p-3 overflow-auto max-h-[400px]">
262262
{JSON.stringify(activeView, null, 2)}
@@ -265,7 +265,7 @@ export function ObjectView({ dataSource, objects, onEdit, onRowClick }: any) {
265265
</div>
266266

267267
<div>
268-
<h4 className="text-xs font-bold uppercase text-muted-foreground mb-2">对象定义</h4>
268+
<h4 className="text-xs font-bold uppercase text-muted-foreground mb-2">Object Definition</h4>
269269
<div className="relative rounded-md border bg-slate-950 text-slate-50 overflow-hidden">
270270
<pre className="text-xs p-3 overflow-auto max-h-[400px]">
271271
{JSON.stringify(objectDef, null, 2)}

apps/console/src/components/PageView.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export function PageView() {
2323
return (
2424
<div className="h-full flex items-center justify-center p-8">
2525
<Empty>
26-
<EmptyTitle>页面未找到</EmptyTitle>
27-
<EmptyDescription>页面 "{pageName}" 不存在。</EmptyDescription>
26+
<EmptyTitle>Page Not Found</EmptyTitle>
27+
<EmptyDescription>The page "{pageName}" could not be found.</EmptyDescription>
2828
</Empty>
2929
</div>
3030
);
@@ -42,7 +42,7 @@ export function PageView() {
4242
size="icon"
4343
className="shadow-md backdrop-blur-sm bg-background/50"
4444
onClick={() => setShowDebug(!showDebug)}
45-
title="切换元数据检查器"
45+
title="Toggle Metadata Inspector"
4646
>
4747
<Code2 className="h-4 w-4" />
4848
</Button>
@@ -58,11 +58,11 @@ export function PageView() {
5858
{showDebug && (
5959
<div className="w-[400px] border-l bg-muted/30 p-0 overflow-hidden flex flex-col shrink-0 shadow-xl z-20 transition-all">
6060
<div className="p-3 border-b bg-muted/50 font-semibold text-sm flex items-center justify-between">
61-
<span>元数据检查器</span>
62-
<span className="text-xs text-muted-foreground">JSON 协议</span>
61+
<span>Metadata Inspector</span>
62+
<span className="text-xs text-muted-foreground">JSON Protocol</span>
6363
</div>
6464
<div className="flex-1 overflow-auto p-4">
65-
<h4 className="text-xs font-bold uppercase text-muted-foreground mb-2">页面配置</h4>
65+
<h4 className="text-xs font-bold uppercase text-muted-foreground mb-2">Page Configuration</h4>
6666
<div className="relative rounded-md border bg-slate-950 text-slate-50 overflow-hidden">
6767
<pre className="text-xs p-3 overflow-auto max-h-[calc(100vh-100px)]">
6868
{JSON.stringify(page, null, 2)}

0 commit comments

Comments
 (0)