fix: worker use only i18n keys instead of full i18n

This commit is contained in:
2026-09-13 12:44:51 +05:00
parent 49d0a9444e
commit c2f3838485
12 changed files with 111 additions and 38 deletions
+10
View File
@@ -20,6 +20,7 @@ type WorkerResponse =
height?: number;
data?: Uint8ClampedArray;
text?: string;
textVars?: Record<string, string | number>;
files?: WorkerImageFile[];
}
| {
@@ -67,6 +68,15 @@ async function handle(request: WorkerRequest): Promise<void> {
} satisfies WorkerResponse);
return;
}
if ("key" in output) {
(self as unknown as Worker).postMessage({
id: request.id,
ok: true,
text: output.key,
textVars: output.vars,
} satisfies WorkerResponse);
return;
}
if ("files" in output) {
const files = output.files.map((file) => ({
name: file.name,