mirror of
https://github.com/zadam/trilium.git
synced 2025-11-15 09:45:52 +01:00
server: Translate login page
This commit is contained in:
@@ -14,6 +14,7 @@ import custom from "./routes/custom.js";
|
||||
import error_handlers from "./routes/error_handlers.js";
|
||||
import { startScheduledCleanup } from "./services/erase.js";
|
||||
import sql_init from "./services/sql_init.js";
|
||||
import { t } from "i18next";
|
||||
|
||||
await import('./services/handlers.js');
|
||||
await import('./becca/becca_loader.js');
|
||||
@@ -29,6 +30,11 @@ sql_init.initializeDb();
|
||||
app.set('views', path.join(scriptDir, 'views'));
|
||||
app.set('view engine', 'ejs');
|
||||
|
||||
app.use((req, res, next) => {
|
||||
res.locals.t = t;
|
||||
return next();
|
||||
});
|
||||
|
||||
if (!utils.isElectron()) {
|
||||
app.use(compression()); // HTTP compression
|
||||
}
|
||||
|
||||
@@ -3,24 +3,24 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>Login</title>
|
||||
<title><%= t("login.title") %></title>
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="<%= assetPath %>/images/app-icons/ios/apple-touch-icon.png">
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="col-xs-12 col-sm-10 col-md-6 col-lg-4 col-xl-4 mx-auto" style="padding-top: 25px;">
|
||||
<h1>Trilium login</h1>
|
||||
<h1><%= t("login.heading") %></h1>
|
||||
|
||||
<% if (failedAuth) { %>
|
||||
<div class="alert alert-warning">
|
||||
Password is incorrect. Please try again.
|
||||
<%= t("login.incorrect-password") %>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
<form action="login" method="POST">
|
||||
<div class="form-group">
|
||||
<label for="password">Password</label>
|
||||
<label for="password"><%= t("login.password") %></label>
|
||||
<div class="controls">
|
||||
<input id="password" name="password" placeholder="" class="form-control" type="password">
|
||||
</div>
|
||||
@@ -28,12 +28,12 @@
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input id="remember-me" name="rememberMe" value="1" type="checkbox"> Remember me
|
||||
<input id="remember-me" name="rememberMe" value="1" type="checkbox"> <%= t("login.remember-me") %>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button class="btn btn-success">Login</button>
|
||||
<button class="btn btn-success"><%= t("login.button") %></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user