chore(core): don't log language option not found if DB not initialized

This commit is contained in:
Elian Doran
2026-03-25 22:55:59 +02:00
parent 6ebf9f59a0
commit 2eef2f801f

View File

@@ -28,14 +28,12 @@ function getCurrentLanguage(): LOCALE_IDS {
let language: string | null = null;
if (sql_init.isDbInitialized()) {
language = options.getOptionOrNull("locale");
if (!language) {
console.info("Language option not found, falling back to en.");
}
}
if (!language) {
console.info("Language option not found, falling back to en.");
language = "en";
}
return language as LOCALE_IDS;
return (language ?? "en") as LOCALE_IDS;
}
export async function changeLanguage(locale: string) {