Files
learnharness/src/server/language.ts
T
sorokin.oleg.edu a50ca4b867
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
feat: add Russian localization and independent STT languages
2026-10-25 17:18:44 +03:00

10 lines
583 B
TypeScript

import { resolveLanguage, type Language } from "../core/i18n.ts";
import { stores } from "./stores.ts";
/** Explicit app preference wins; automatic follow-ups retain the foreground browser's language. */
export function applicationLanguage(system?: string | null): Language {
return resolveLanguage(stores.settingsStore.readSettings()?.general?.language, system ?? process.env.LH_SYSTEM_LANGUAGE ?? Intl.DateTimeFormat().resolvedOptions().locale);
}
export function chatLanguage(chatId: string): Language {
return applicationLanguage(stores.chatStore.getChat(chatId)?.language);
}