Skip to content

Build your personal knowledge base with Trilium Notes

fix(standalone): open an execution context for the startup locale change

Elian Doran506c5f8a369d
diff --git a/apps/standalone/src/local-server-worker.ts b/apps/standalone/src/local-server-worker.ts
index 019ef90d15..61914335c9 100644
--- a/apps/standalone/src/local-server-worker.ts
+++ b/apps/standalone/src/local-server-worker.ts
@@ -359,7 +359,9 @@ async function initialize(): Promise<void> {
const dbLocale = coreModule.options.getOptionOrNull("locale");
if (dbLocale && dbLocale !== "en") {
logService.info(`[Worker] Reconciling i18next locale to "${dbLocale}" from DB`);
- await coreModule.i18n.changeLanguage(dbLocale);
+ // `changeLanguage` rebuilds the hidden subtree, and committing that writes
+ // entity change ids into the execution context, so it needs one open.
+ await coreModule.getContext().init(() => coreModule.i18n.changeLanguage(dbLocale));
}
} else {
logService.info("[Worker] Database not initialized, skipping becca load (will be loaded during DB initialization)");