From 389b4c0db71db6b5b4b3e013c28a896e2704f2f8 Mon Sep 17 00:00:00 2001 From: happymy <598176144@qq.com> Date: Sun, 13 Sep 2026 08:19:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(i18n):=20=E6=B8=85=E9=99=A4=E5=89=A9?= =?UTF-8?q?=E4=BD=99=E7=A1=AC=E7=BC=96=E7=A0=81=E8=8B=B1=E6=96=87=E6=96=87?= =?UTF-8?q?=E6=A1=88=E5=B9=B6=E6=8E=A5=E5=85=A5=E5=AD=97=E5=85=B8=20?= =?UTF-8?q?=E6=B6=88=E9=99=A4=20canvas=20=E9=A1=B5=202=20=E5=A4=84=20aria-?= =?UTF-8?q?label=20=E4=B8=8E=20Unlink=20=E6=8C=89=E9=92=AE=E3=80=81Languag?= =?UTF-8?q?eSwitcher=20aria=E3=80=81QueueStage=20"Clip=20#"=E3=80=81StoryS?= =?UTF-8?q?tage=20"New=20beat"=E3=80=81JobInputsDrawer=20"Job=20#"=20?= =?UTF-8?q?=E7=AD=89=E7=A1=AC=E7=BC=96=E7=A0=81=E8=8B=B1=E6=96=87=EF=BC=9B?= =?UTF-8?q?en/zh=20=E5=AD=97=E5=85=B8=E5=90=8C=E6=AD=A5=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=206=20=E7=BB=84=20key=20=E4=BF=9D=E6=8C=81=E5=AF=B9=E9=BD=90?= =?UTF-8?q?=E3=80=82npm=20run=20check=200=20errors=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- calliope-web/src/lib/components/LanguageSwitcher.svelte | 3 ++- calliope-web/src/lib/components/QueueStage.svelte | 2 +- calliope-web/src/lib/components/StoryStage.svelte | 2 +- .../src/lib/components/video/JobInputsDrawer.svelte | 2 +- calliope-web/src/lib/i18n/en.ts | 6 ++++++ calliope-web/src/lib/i18n/zh.ts | 6 ++++++ calliope-web/src/routes/canvas/[id]/+page.svelte | 6 +++--- 7 files changed, 20 insertions(+), 7 deletions(-) diff --git a/calliope-web/src/lib/components/LanguageSwitcher.svelte b/calliope-web/src/lib/components/LanguageSwitcher.svelte index 909576bf..39c35b22 100644 --- a/calliope-web/src/lib/components/LanguageSwitcher.svelte +++ b/calliope-web/src/lib/components/LanguageSwitcher.svelte @@ -1,11 +1,12 @@ setLanguage(e.currentTarget.value as Language)} > English diff --git a/calliope-web/src/lib/components/QueueStage.svelte b/calliope-web/src/lib/components/QueueStage.svelte index 0943037e..76cc4cf7 100644 --- a/calliope-web/src/lib/components/QueueStage.svelte +++ b/calliope-web/src/lib/components/QueueStage.svelte @@ -166,7 +166,7 @@ for (const sc of scenes) { if (sc.video_path) { opts.push({ - label: `Clip #${sc.order_index} · ${sc.heading || t('queue.sceneLabel')}`, + label: `${t('queue.clipLabel', { n: sc.order_index })} · ${sc.heading || t('queue.sceneLabel')}`, path: sc.video_path, kind: 'video', group: 'clip', diff --git a/calliope-web/src/lib/components/StoryStage.svelte b/calliope-web/src/lib/components/StoryStage.svelte index de57b38c..22e881bf 100644 --- a/calliope-web/src/lib/components/StoryStage.svelte +++ b/calliope-web/src/lib/components/StoryStage.svelte @@ -216,7 +216,7 @@ headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ order_index: nextIndex, - title: `New beat ${nextIndex}`, + title: t('story.newBeat', { n: nextIndex }), description: '', }), }); diff --git a/calliope-web/src/lib/components/video/JobInputsDrawer.svelte b/calliope-web/src/lib/components/video/JobInputsDrawer.svelte index 43cf94ce..1ac02c06 100644 --- a/calliope-web/src/lib/components/video/JobInputsDrawer.svelte +++ b/calliope-web/src/lib/components/video/JobInputsDrawer.svelte @@ -215,7 +215,7 @@ function applyToScene() { {/if} - Job #{activeJob.id} + {t('queue.jobLabel', { n: activeJob.id })} · {activeJob.status} {#if activeJob.completed_at} diff --git a/calliope-web/src/lib/i18n/en.ts b/calliope-web/src/lib/i18n/en.ts index 5b749fab..0124b7f0 100644 --- a/calliope-web/src/lib/i18n/en.ts +++ b/calliope-web/src/lib/i18n/en.ts @@ -24,6 +24,7 @@ export const en = { 'common.send': 'Send', 'common.stop': 'Stop', 'common.title': 'Title', + 'common.language': 'Language', // --- App shell / nav --- 'nav.canvas': 'AI Canvas', @@ -248,6 +249,8 @@ export const en = { 'canvas.sessionDeleted': 'Session deleted', 'canvas.chatUnlinked': 'Chat unlinked — moved to Sandbox', 'canvas.unlinkFailed': 'Unlink failed', + 'canvas.unlinkButton': 'Unlink', + 'canvas.resizePanel': 'Resize chat panel (drag or arrow keys), currently {width} pixels', 'canvas.sendFailed': 'Failed to send', 'canvas.runCancelled': 'Run cancelled', 'canvas.cancelFailed': 'Cancel failed', @@ -416,6 +419,7 @@ export const en = { 'story.saveSettingsFailed': 'Could not save settings', 'story.settingsTitle': 'Story settings', 'story.llmBanner': 'The story stage uses the active LLM to draft and refine beats.', + 'story.newBeat': 'New beat {n}', // --- Assets stage --- 'assets.title': 'Assets', @@ -610,6 +614,8 @@ export const en = { // --- Queue stage --- 'queue.sceneLabel': 'Scene', + 'queue.clipLabel': 'Clip #{n}', + 'queue.jobLabel': 'Job #{n}', 'queue.scene': 'Scene {n}', 'queue.sceneRef': 'Scene reference', 'queue.clipRef': 'Clip reference', diff --git a/calliope-web/src/lib/i18n/zh.ts b/calliope-web/src/lib/i18n/zh.ts index 51da3e66..343dd77d 100644 --- a/calliope-web/src/lib/i18n/zh.ts +++ b/calliope-web/src/lib/i18n/zh.ts @@ -26,6 +26,7 @@ export const zh: Dict = { 'common.send': '发送', 'common.stop': '停止', 'common.title': '标题', + 'common.language': '语言', // --- App shell / nav --- 'nav.canvas': 'AI 画布', @@ -248,6 +249,8 @@ export const zh: Dict = { 'canvas.sessionDeleted': '对话已删除', 'canvas.chatUnlinked': '对话已取消关联——已移至沙盒', 'canvas.unlinkFailed': '取消关联失败', + 'canvas.unlinkButton': '解除关联', + 'canvas.resizePanel': '调整对话面板大小(拖拽或方向键),当前 {width} 像素', 'canvas.sendFailed': '发送失败', 'canvas.runCancelled': '运行已取消', 'canvas.cancelFailed': '取消失败', @@ -416,6 +419,7 @@ export const zh: Dict = { 'story.saveSettingsFailed': '无法保存设置', 'story.settingsTitle': '故事设置', 'story.llmBanner': '故事阶段使用当前激活的大语言模型来起草和润色节拍。', + 'story.newBeat': '新节拍 {n}', // --- Assets stage --- 'assets.title': '素材', @@ -610,6 +614,8 @@ export const zh: Dict = { // --- Queue stage --- 'queue.sceneLabel': '场景', + 'queue.clipLabel': '片段 #{n}', + 'queue.jobLabel': '任务 #{n}', 'queue.scene': '场景 {n}', 'queue.sceneRef': '场景参考', 'queue.clipRef': '片段参考', diff --git a/calliope-web/src/routes/canvas/[id]/+page.svelte b/calliope-web/src/routes/canvas/[id]/+page.svelte index 64fca027..0b818d4a 100644 --- a/calliope-web/src/routes/canvas/[id]/+page.svelte +++ b/calliope-web/src/routes/canvas/[id]/+page.svelte @@ -1035,10 +1035,10 @@ title={running : activeSession ? t('canvas.unlinkFrom', { title: canvas.project.title }) : t('canvas.noChatYet')} - aria-label={`Unlink this chat from ${canvas.project.title}`} + aria-label={t('canvas.unlinkFrom', { title: canvas.project.title })} > - Unlink + {t('canvas.unlinkButton')} {:else} @@ -1097,7 +1097,7 @@ title={running type="button" class="chat-splitter" class:dragging - aria-label={`Resize chat panel (drag or arrow keys), currently ${Math.round(chatWidth)} pixels`} + aria-label={t('canvas.resizePanel', { width: Math.round(chatWidth) })} onmousedown={startDrag} onkeydown={(e) => { if (e.key === 'ArrowLeft') {