Skip to content

Commit 50e4a3b

Browse files
committed
chore(examples): translate Chinese UI copy to English
1 parent 9e3b5bd commit 50e4a3b

4 files changed

Lines changed: 48 additions & 47 deletions

File tree

examples/runtime/browser-runtime-example.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@
144144
</head>
145145
<body>
146146
<div class="page">
147-
<h1>Renderify Runtime 浏览器示例</h1>
147+
<h1>Renderify Runtime Browser Example</h1>
148148
<p class="hint">
149-
这个页面不依赖打包器,直接使用本地 UMD bundle。示例内置了一个最小
150-
Demo LLM(仅用于本地演示)。
149+
This page does not rely on a bundler and uses the local UMD bundle directly.
150+
It includes a minimal demo LLM (for local demo use only).
151151
</p>
152152

153153
<div class="grid">
@@ -300,7 +300,7 @@ <h2>Streaming Chunks</h2>
300300
renderButton.addEventListener("click", async function () {
301301
const prompt = promptInput.value.trim();
302302
if (!prompt) {
303-
setStatus("Prompt 不能为空。");
303+
setStatus("Prompt cannot be empty.");
304304
return;
305305
}
306306

@@ -331,7 +331,7 @@ <h2>Streaming Chunks</h2>
331331
streamButton.addEventListener("click", async function () {
332332
const prompt = promptInput.value.trim();
333333
if (!prompt) {
334-
setStatus("Prompt 不能为空。");
334+
setStatus("Prompt cannot be empty.");
335335
return;
336336
}
337337

examples/runtime/browser-tsx-jspm-example.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,11 @@
113113
</head>
114114
<body>
115115
<div class="page">
116-
<h1>Renderify: LLM 产出 TSX -> Runtime Babel -> JSPM 直接执行</h1>
116+
<h1>Renderify: LLM-Generated TSX -> Runtime Babel -> Direct JSPM Execution</h1>
117117
<p class="desc">
118-
这个示例会让 LLM 返回 <code>```tsx</code> 代码块。Renderify 会在运行时用 Babel 转译,
119-
然后通过 JSPM 解析依赖并直接执行,不需要构建发布。
118+
This example asks the LLM to return a <code>```tsx</code> code block.
119+
Renderify transpiles it with Babel at runtime, resolves dependencies through JSPM,
120+
and executes it directly with no build step.
120121
</p>
121122

122123
<div class="grid">

examples/todo/react-shadcn-todo-hash.html

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@
361361
const [todos, setTodos] = useState(initialHashState?.todos ?? loadTodos());
362362
const [value, setValue] = useState("");
363363
const [filter, setFilter] = useState(initialHashState?.filter ?? "all");
364-
const [flash, setFlash] = useState(initialHashState ? "已从 hash 恢复状态" : "");
364+
const [flash, setFlash] = useState(initialHashState ? "State restored from hash" : "");
365365

366366
useEffect(() => {
367367
localStorage.setItem(STORAGE_KEY, JSON.stringify(todos));
@@ -382,7 +382,7 @@
382382
if (!next) return;
383383
setTodos(next.todos);
384384
setFilter(next.filter);
385-
setFlash("已按 hash 更新");
385+
setFlash("Updated from hash");
386386
};
387387
window.addEventListener("hashchange", onHashChange);
388388
return () => window.removeEventListener("hashchange", onHashChange);
@@ -426,20 +426,20 @@
426426

427427
const resetDemo = () => {
428428
setTodos([
429-
{ id: uid(), text: "整理今天最重要的 3 件事", done: false },
429+
{ id: uid(), text: "List the top 3 priorities for today", done: false },
430430
{ id: uid(), text: "Review PR #142", done: true },
431-
{ id: uid(), text: "给团队同步 demo 进展", done: false },
431+
{ id: uid(), text: "Share demo progress with the team", done: false },
432432
]);
433433
setFilter("all");
434-
setFlash("已重置示例");
434+
setFlash("Demo reset");
435435
};
436436

437437
const copyShareLink = async () => {
438438
try {
439439
await navigator.clipboard.writeText(window.location.href);
440-
setFlash("分享链接已复制");
440+
setFlash("Share link copied");
441441
} catch {
442-
setFlash("复制失败,请手动复制地址栏");
442+
setFlash("Copy failed. Please copy the address bar manually.");
443443
}
444444
};
445445

@@ -449,26 +449,26 @@
449449
<header className="card-header">
450450
<h1 className="card-title">React + shadcn Todo (Hash Share)</h1>
451451
<p className="card-description">
452-
状态自动同步到 URL hash,发链接即可复现当前页面。
452+
State syncs automatically to the URL hash, so sharing the link reproduces this view.
453453
</p>
454454
</header>
455455
456456
<div className="card-content">
457457
<div className="row">
458458
<input
459459
className="input"
460-
placeholder="输入待办,例如:设计 runtime streaming API"
460+
placeholder="Add a task, e.g. design runtime streaming API"
461461
value=${value}
462462
onChange=${(event) => setValue(event.target.value)}
463463
onKeyDown=${onInputKeyDown}
464464
/>
465465
<button className="btn btn-primary" onClick=${addTodo} disabled=${!value.trim()}>
466-
添加
466+
Add
467467
</button>
468468
</div>
469469
470470
${filtered.length === 0
471-
? html`<div className="todo-empty">当前筛选下没有任务。</div>`
471+
? html`<div className="todo-empty">No tasks under the current filter.</div>`
472472
: html`
473473
<ul className="todo-list">
474474
${filtered.map(
@@ -486,10 +486,10 @@ <h1 className="card-title">React + shadcn Todo (Hash Share)</h1>
486486
<button
487487
className="btn btn-ghost"
488488
onClick=${() => removeTodo(todo.id)}
489-
aria-label="删除"
490-
title="删除"
489+
aria-label="Delete"
490+
title="Delete"
491491
>
492-
删除
492+
Delete
493493
</button>
494494
</li>
495495
`,
@@ -503,37 +503,37 @@ <h1 className="card-title">React + shadcn Todo (Hash Share)</h1>
503503
className=${`btn btn-outline ${filter === "all" ? "active" : ""}`}
504504
onClick=${() => setFilter("all")}
505505
>
506-
全部
506+
All
507507
</button>
508508
<button
509509
className=${`btn btn-outline ${filter === "active" ? "active" : ""}`}
510510
onClick=${() => setFilter("active")}
511511
>
512-
进行中
512+
Active
513513
</button>
514514
<button
515515
className=${`btn btn-outline ${filter === "done" ? "active" : ""}`}
516516
onClick=${() => setFilter("done")}
517517
>
518-
已完成
518+
Completed
519519
</button>
520520
</div>
521521
522522
<div className="row">
523-
<span className="badge">剩余 ${leftCount} </span>
524-
<button className="btn btn-danger" onClick=${clearDone}>清理已完成</button>
525-
<button className="btn btn-ghost" onClick=${resetDemo}>重置示例</button>
526-
<button className="btn btn-outline" onClick=${copyShareLink}>复制分享链接</button>
523+
<span className="badge">${leftCount} remaining</span>
524+
<button className="btn btn-danger" onClick=${clearDone}>Clear completed</button>
525+
<button className="btn btn-ghost" onClick=${resetDemo}>Reset demo</button>
526+
<button className="btn btn-outline" onClick=${copyShareLink}>Copy share link</button>
527527
</div>
528528
</div>
529529
530530
<div className="hash-hint">
531-
Hash 字段:<code>#state64=&lt;base64url(json)&gt;</code>
531+
Hash field: <code>#state64=&lt;base64url(json)&gt;</code>
532532
${flash ? html`<div style=${{ marginTop: 6, color: "#0f766e", fontWeight: 600 }}>${flash}</div>` : null}
533533
</div>
534534
535535
<p className="muted" style=${{ marginTop: 12, fontSize: 12 }}>
536-
提示:本地也会保存到 LocalStorage。手动改 hash 后会自动重载状态。
536+
Tip: state is also saved to LocalStorage. Manually editing the hash auto-reloads state.
537537
</p>
538538
</div>
539539
</section>

examples/todo/react-shadcn-todo.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,9 @@
333333

334334
const resetDemo = () => {
335335
setTodos([
336-
{ id: uid(), text: "整理今天最重要的 3 件事", done: false },
336+
{ id: uid(), text: "List the top 3 priorities for today", done: false },
337337
{ id: uid(), text: "Review PR #142", done: true },
338-
{ id: uid(), text: "给团队同步 demo 进展", done: false },
338+
{ id: uid(), text: "Share demo progress with the team", done: false },
339339
]);
340340
};
341341

@@ -345,26 +345,26 @@
345345
<header className="card-header">
346346
<h1 className="card-title">React + shadcn Todo Demo</h1>
347347
<p className="card-description">
348-
单文件可直接打开(无构建),本地持久化在 LocalStorage
348+
Single-file demo that opens directly (no build), persisted in LocalStorage.
349349
</p>
350350
</header>
351351
352352
<div className="card-content">
353353
<div className="row">
354354
<input
355355
className="input"
356-
placeholder="输入待办,例如:设计 runtime streaming API"
356+
placeholder="Add a task, e.g. design runtime streaming API"
357357
value=${value}
358358
onChange=${(event) => setValue(event.target.value)}
359359
onKeyDown=${onInputKeyDown}
360360
/>
361361
<button className="btn btn-primary" onClick=${addTodo} disabled=${!value.trim()}>
362-
添加
362+
Add
363363
</button>
364364
</div>
365365
366366
${filtered.length === 0
367-
? html`<div className="todo-empty">当前筛选下没有任务。</div>`
367+
? html`<div className="todo-empty">No tasks under the current filter.</div>`
368368
: html`
369369
<ul className="todo-list">
370370
${filtered.map(
@@ -382,10 +382,10 @@ <h1 className="card-title">React + shadcn Todo Demo</h1>
382382
<button
383383
className="btn btn-ghost"
384384
onClick=${() => removeTodo(todo.id)}
385-
aria-label="删除"
386-
title="删除"
385+
aria-label="Delete"
386+
title="Delete"
387387
>
388-
删除
388+
Delete
389389
</button>
390390
</li>
391391
`,
@@ -399,35 +399,35 @@ <h1 className="card-title">React + shadcn Todo Demo</h1>
399399
className=${`btn btn-outline ${filter === "all" ? "active" : ""}`}
400400
onClick=${() => setFilter("all")}
401401
>
402-
全部
402+
All
403403
</button>
404404
<button
405405
className=${`btn btn-outline ${filter === "active" ? "active" : ""}`}
406406
onClick=${() => setFilter("active")}
407407
>
408-
进行中
408+
Active
409409
</button>
410410
<button
411411
className=${`btn btn-outline ${filter === "done" ? "active" : ""}`}
412412
onClick=${() => setFilter("done")}
413413
>
414-
已完成
414+
Completed
415415
</button>
416416
</div>
417417
418418
<div className="row">
419-
<span className="badge">剩余 ${leftCount} </span>
419+
<span className="badge">${leftCount} remaining</span>
420420
<button className="btn btn-danger" onClick=${clearDone}>
421-
清理已完成
421+
Clear completed
422422
</button>
423423
<button className="btn btn-ghost" onClick=${resetDemo}>
424-
重置示例
424+
Reset demo
425425
</button>
426426
</div>
427427
</div>
428428
429429
<p className="muted" style=${{ marginTop: 12, fontSize: 12 }}>
430-
提示:数据保存在浏览器 LocalStorage,刷新页面会保留。
430+
Tip: data is saved in browser LocalStorage and persists across refreshes.
431431
</p>
432432
</div>
433433
</section>

0 commit comments

Comments
 (0)