feat: add Russian localization and independent STT languages
CI / Typecheck, tests, lint (push) Canceled after 0s
CI / Standalone (mac-arm64) (push) Canceled after 0s
CI / Standalone (linux-x64) (push) Canceled after 0s
CI / Standalone (windows-x64) (push) Canceled after 0s

This commit is contained in:
2026-10-25 17:18:44 +03:00
parent b277ee3e0f
commit a50ca4b867
93 changed files with 3261 additions and 904 deletions
+4 -4
View File
@@ -11,14 +11,14 @@
* markers are invisible by the engine's law).
*/
import { sessionMarkdown } from "@/src/core";
import { getChat } from "@/src/server";
import { getChat, applicationLanguage } from "@/src/server";
/** Filename-safe title (own module scope on purpose: tiny + pure). */
function slugify(title: string): string {
const slug = title
.toLowerCase()
.normalize("NFKD")
.replace(/[^a-z0-9]+/g, "-")
.replace(/[^\p{L}\p{N}]+/gu, "-")
.replace(/^-+|-+$/g, "");
return slug.length > 0 ? slug : "session";
}
@@ -27,11 +27,11 @@ export async function GET(_req: Request, ctx: { params: Promise<{ id: string }>
const { id } = await ctx.params;
const record = getChat(id);
if (!record) return Response.json({ error: "Unknown chat" }, { status: 404 });
const markdown = sessionMarkdown(record.messages, { title: record.title, anchors: false });
const markdown = sessionMarkdown(record.messages, { title: record.title, anchors: false, language: applicationLanguage(_req.headers.get("accept-language")) });
return new Response(markdown, {
headers: {
"content-type": "text/markdown; charset=utf-8",
"content-disposition": `attachment; filename="${slugify(record.title)}.md"`,
"content-disposition": `attachment; filename="${/^[a-z0-9-]+$/.test(slugify(record.title)) ? slugify(record.title) : "session"}.md"; filename*=UTF-8''${encodeURIComponent(slugify(record.title))}.md`,
},
});
}
+2 -2
View File
@@ -13,7 +13,7 @@
* healthy. The dock's chips + graph refetch track progress live through
* /api/graph/status, as with session runs.
*/
import { extraction, NotesImportError } from "@/src/server";
import { extraction, NotesImportError, applicationLanguage } from "@/src/server";
import {
ModelsNotConfiguredError,
PROVIDER_KEY_MISSING_CODE,
@@ -56,7 +56,7 @@ export async function POST(request: Request) {
const { file, requestIndex } = next;
try {
const text = await file.text();
const stats = await extraction.importNotes({ filePath: file.name, text });
const stats = await extraction.importNotes({ filePath: file.name, text, language: applicationLanguage(request.headers.get("accept-language")) });
results.push({ filePath: file.name, requestIndex, outcome: "completed", ok: true, stats });
} catch (err) {
if (err instanceof ModelsNotConfiguredError) {