diff --git a/.gitignore b/.gitignore index b060e466..df923c59 100644 --- a/.gitignore +++ b/.gitignore @@ -36,8 +36,6 @@ calliope-backend/src/calliope/static/ # Electron shell was dropped — keep ignoring so a leftover folder cannot be committed. electron/ AGENTS.md -start.bat -end.bat ScreenShots/ docs/* !docs/changelogs/ diff --git a/calliope-web/src/hooks.client.ts b/calliope-web/src/hooks.client.ts index 6fa26381..496b069b 100644 --- a/calliope-web/src/hooks.client.ts +++ b/calliope-web/src/hooks.client.ts @@ -1,8 +1,9 @@ import type { HandleClientError } from '@sveltejs/kit'; +import { t } from '$lib/i18n.svelte'; export const handleError: HandleClientError = ({ error }) => { console.error(error); return { - message: 'Something went wrong.', + message: t('global.somethingWentWrong'), }; }; diff --git a/calliope-web/src/lib/agentTasks.ts b/calliope-web/src/lib/agentTasks.ts index 6b4b20f2..2ab0e53f 100644 --- a/calliope-web/src/lib/agentTasks.ts +++ b/calliope-web/src/lib/agentTasks.ts @@ -17,10 +17,10 @@ export const AGENT_TASK_PROMPTS: Record = { 'Regenerate the full script for this project — turn the storyline into ordered scenes with action and dialogue.', }; -/** A sidebar-friendly title for the auto-created session. */ -export const AGENT_TASK_TITLES: Record = { - story: 'Draft Storyline', - script: 'Regenerate Script', +/** i18n key for the auto-created session's sidebar title. */ +export const AGENT_TASK_TITLE_KEYS: Record = { + story: 'agent.task.story', + script: 'agent.task.script', }; export function isAgentTaskKind(value: string | null | undefined): value is AgentTaskKind { diff --git a/calliope-web/src/lib/api.ts b/calliope-web/src/lib/api.ts index cc2a2e47..2e2d8f72 100644 --- a/calliope-web/src/lib/api.ts +++ b/calliope-web/src/lib/api.ts @@ -1,4 +1,5 @@ import type { AgentComposerPayload } from '$lib/agentComposer'; +import { t } from '$lib/i18n.svelte'; const API_BASE = ''; @@ -124,7 +125,7 @@ async function api(path: string, init?: RequestInit): Promise { }, }); if (!res.ok) { - const body = await res.text().catch(() => 'unknown error'); + const body = await res.text().catch(() => t('api.unknownError')); throw new Error(`${res.status}: ${body}`); } return res.json() as Promise; @@ -134,7 +135,7 @@ async function api(path: string, init?: RequestInit): Promise { async function apiUpload(path: string, form: FormData): Promise { const res = await fetch(`${API_BASE}${path}`, { method: 'POST', body: form }); if (!res.ok) { - const body = await res.text().catch(() => 'unknown error'); + const body = await res.text().catch(() => t('api.unknownError')); throw new Error(`${res.status}: ${body}`); } return res.json() as Promise; diff --git a/calliope-web/src/lib/canvas/ArtifactNode.svelte b/calliope-web/src/lib/canvas/ArtifactNode.svelte index 5ab04f3c..44c732cc 100644 --- a/calliope-web/src/lib/canvas/ArtifactNode.svelte +++ b/calliope-web/src/lib/canvas/ArtifactNode.svelte @@ -2,6 +2,7 @@ import { type Node, type NodeProps } from '@xyflow/svelte'; import SafeMedia from '$lib/components/SafeMedia.svelte'; import { assetUrl } from '$lib/api'; + import { t } from '$lib/i18n.svelte'; interface ArtifactNodeData extends Record { canvasNodeId: number; @@ -37,9 +38,9 @@ {data.kind} {data.title} {#if running} - running + {t('canvas.running')} {:else if data.status === 'failed'} - failed + {t('canvas.failed')} {:else if videoSrc} {/if} @@ -51,7 +52,7 @@ type="button" class="media-btn" onclick={openPreview} - title="Open large preview" + title={t('canvas.openPreview')} >