Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
chore(server): improve & translate DB not initialized message
Elian Dorand6e6e78acce6
diff --git a/apps/server/src/assets/translations/en/server.json b/apps/server/src/assets/translations/en/server.jsonindex 5837c73214..f7db941a63 100644--- a/apps/server/src/assets/translations/en/server.json+++ b/apps/server/src/assets/translations/en/server.json@@ -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."}}diff --git a/apps/server/src/services/sql_init.ts b/apps/server/src/services/sql_init.tsindex 3f0e839cdf..541e487a06 100644--- a/apps/server/src/services/sql_init.ts+++ b/apps/server/src/services/sql_init.ts@@ -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;}