Skip to content

Build your personal knowledge base with Trilium Notes

chore(rtl): address 2nd set of requested changes

Elian Doran492f48199959
diff --git a/apps/server/src/assets/views/set_password.ejs b/apps/server/src/assets/views/set_password.ejs
index e861af0d24..56d4ef1118 100644
--- a/apps/server/src/assets/views/set_password.ejs
+++ b/apps/server/src/assets/views/set_password.ejs
@@ -11,7 +11,7 @@
<link rel="stylesheet" href="<%= assetPath %>/stylesheets/style.css">
<script src="<%= appPath %>/runtime.js" crossorigin type="module"></script>
</head>
-<body>
+<body lang="<%= currentLocale.id %>" dir="<%= currentLocale.rtl ? 'rtl' : 'ltr' %>">
<div class="container set-password">
<div class="col-xs-12 col-sm-10 col-md-6 col-lg-4 col-xl-4 mx-auto pt-4">
<h1><%= t("set_password.heading") %></h1>
diff --git a/apps/server/src/assets/views/setup.ejs b/apps/server/src/assets/views/setup.ejs
index b477a6bc98..8695426447 100644
--- a/apps/server/src/assets/views/setup.ejs
+++ b/apps/server/src/assets/views/setup.ejs
@@ -45,7 +45,7 @@
</style>
<script src="<%= appPath %>/runtime.js" crossorigin type="module"></script>
</head>
-<body>
+<body lang="<%= currentLocale.id %>" dir="<%= currentLocale.rtl ? 'rtl' : 'ltr' %>">
<noscript><%= t("javascript-required") %></noscript>
<div class="container">
<div id="setup-dialog" class="col-md-12 col-lg-8 col-xl-6 mx-auto" style="padding-top: 25px; font-size: larger; display: none;">
diff --git a/apps/server/src/routes/login.ts b/apps/server/src/routes/login.ts
index 873562cd03..1126d9a7ff 100644
--- a/apps/server/src/routes/login.ts
+++ b/apps/server/src/routes/login.ts
@@ -33,7 +33,8 @@ function setPasswordPage(req: Request, res: Response) {
res.render("set_password", {
error: false,
assetPath,
- appPath
+ appPath,
+ currentLocale: getCurrentLocale()
});
}
@@ -58,7 +59,8 @@ function setPassword(req: Request, res: Response) {
res.render("set_password", {
error,
assetPath,
- appPath
+ appPath,
+ currentLocale: getCurrentLocale()
});
return;
}
diff --git a/apps/server/src/routes/setup.ts b/apps/server/src/routes/setup.ts
index 5bb0f56c91..4a2a8699ab 100644
--- a/apps/server/src/routes/setup.ts
+++ b/apps/server/src/routes/setup.ts
@@ -6,6 +6,7 @@ import { isElectron } from "../services/utils.js";
import assetPath from "../services/asset_path.js";
import appPath from "../services/app_path.js";
import type { Request, Response } from "express";
+import { getCurrentLocale } from "../services/i18n.js";
function setupPage(req: Request, res: Response) {
if (sqlInit.isDbInitialized()) {
@@ -30,7 +31,8 @@ function setupPage(req: Request, res: Response) {
res.render("setup", {
syncInProgress: syncInProgress,
assetPath: assetPath,
- appPath: appPath
+ appPath: appPath,
+ currentLocale: getCurrentLocale()
});
}
@@ -39,7 +41,7 @@ async function handleElectronRedirect() {
const { app } = await import("electron");
// Wait for the main window to be created before closing the setup window to prevent triggering `window-all-closed`.
- await windowService.createMainWindow(app);
+ await windowService.createMainWindow(app);
windowService.closeSetupWindow();
const tray = (await import("../services/tray.js")).default;