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')} >