server: Initialize backend translations

This commit is contained in:
Elian Doran
2024-09-08 14:37:40 +03:00
parent c33154d128
commit c1010a79f9
7 changed files with 26 additions and 2 deletions

View File

@@ -12,6 +12,8 @@ import utils from "./services/utils.js";
import port from "./services/port.js";
import host from "./services/host.js";
import semver from "semver";
import i18next from "i18next";
import Backend from "i18next-fs-backend";
// setup basic error handling even before requiring dependencies, since those can produce errors as well
@@ -57,6 +59,17 @@ async function startTrilium() {
(await import('electron')).app.requestSingleInstanceLock();
}
// Initialize translations
i18next.use(Backend).init({
lng: "ro",
fallbackLng: "en",
ns: "server",
backend: {
loadPath: "translations/{{lng}}/{{ns}}.json"
},
debug: true
});
log.info(JSON.stringify(appInfo, null, 2));
// for perf. issues it's good to know the rough configuration