feat(i18n): 全量中英双语字典与组件接入

- en.ts 934 键无重复,zh.ts 全量镜像
- 补齐 assets/buildScene/queue 缺失键,修正 promptPreview.sceneMeta/shotMeta 占位符
- i18n.svelte.ts 修复 \ 响应式语言状态
- 修复 QueueStage/ToastHost 局部变量遮蔽 t()
This commit is contained in:
happymy
2026-09-12 13:00:19 +08:00
parent 929df8c9b6
commit be0f5b6046
64 changed files with 3540 additions and 1341 deletions
+3 -2
View File
@@ -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<T>(path: string, init?: RequestInit): Promise<T> {
},
});
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<T>;
@@ -134,7 +135,7 @@ async function api<T>(path: string, init?: RequestInit): Promise<T> {
async function apiUpload<T>(path: string, form: FormData): Promise<T> {
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<T>;