chore(server): improve & translate DB not initialized message

This commit is contained in:
Elian Doran 2025-09-12 12:49:25 +03:00
parent 0e5e439f69
commit d6e6e78acc
No known key found for this signature in database
2 changed files with 10 additions and 1 deletions

View File

@ -424,5 +424,9 @@
"board_status_todo": "To Do",
"board_status_progress": "In Progress",
"board_status_done": "Done"
},
"sql_init": {
"db_not_initialized_desktop": "DB not initialized, please follow on-screen instructions.",
"db_not_initialized_server": "DB not initialized, please visit setup page - http://[your-server-host]:{{port}} to see instructions on how to initialize Trilium."
}
}

View File

@ -17,6 +17,7 @@ import zipImportService from "./import/zip.js";
import password from "./encryption/password.js";
import backup from "./backup.js";
import eventService from "./events.js";
import { t } from "i18next";
export const dbReady = deferred<void>();
@ -37,7 +38,11 @@ function isDbInitialized() {
async function initDbConnection() {
if (!isDbInitialized()) {
log.info(`DB not initialized, please visit setup page` + (isElectron ? "" : ` - http://[your-server-host]:${port} to see instructions on how to initialize Trilium.`));
if (isElectron) {
log.info(t("sql_init.db_not_initialized_desktop"));
} else {
log.info(t("sql_init.db_not_initialized_server", { port }));
}
return;
}