mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 13:01:31 +08:00 
			
		
		
		
	server: Translate login page
This commit is contained in:
		
							parent
							
								
									317b7b4c59
								
							
						
					
					
						commit
						c25c8c753d
					
				| @ -14,6 +14,7 @@ import custom from "./routes/custom.js"; | |||||||
| import error_handlers from "./routes/error_handlers.js"; | import error_handlers from "./routes/error_handlers.js"; | ||||||
| import { startScheduledCleanup } from "./services/erase.js"; | import { startScheduledCleanup } from "./services/erase.js"; | ||||||
| import sql_init from "./services/sql_init.js"; | import sql_init from "./services/sql_init.js"; | ||||||
|  | import { t } from "i18next"; | ||||||
| 
 | 
 | ||||||
| await import('./services/handlers.js'); | await import('./services/handlers.js'); | ||||||
| await import('./becca/becca_loader.js'); | await import('./becca/becca_loader.js'); | ||||||
| @ -29,6 +30,11 @@ sql_init.initializeDb(); | |||||||
| app.set('views', path.join(scriptDir, 'views')); | app.set('views', path.join(scriptDir, 'views')); | ||||||
| app.set('view engine', 'ejs'); | app.set('view engine', 'ejs'); | ||||||
| 
 | 
 | ||||||
|  | app.use((req, res, next) => { | ||||||
|  |     res.locals.t = t; | ||||||
|  |     return next(); | ||||||
|  | }); | ||||||
|  | 
 | ||||||
| if (!utils.isElectron()) { | if (!utils.isElectron()) { | ||||||
|     app.use(compression()); // HTTP compression
 |     app.use(compression()); // HTTP compression
 | ||||||
| } | } | ||||||
|  | |||||||
| @ -3,24 +3,24 @@ | |||||||
| <head> | <head> | ||||||
|     <meta charset="utf-8"> |     <meta charset="utf-8"> | ||||||
|     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |     <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="apple-touch-icon" sizes="180x180" href="<%= assetPath %>/images/app-icons/ios/apple-touch-icon.png"> | ||||||
|     <link rel="shortcut icon" href="favicon.ico"> |     <link rel="shortcut icon" href="favicon.ico"> | ||||||
| </head> | </head> | ||||||
| <body> | <body> | ||||||
| <div class="container"> | <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;"> |     <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) { %> |         <% if (failedAuth) { %> | ||||||
|             <div class="alert alert-warning"> |             <div class="alert alert-warning"> | ||||||
|                 Password is incorrect. Please try again. |                 <%= t("login.incorrect-password") %> | ||||||
|             </div> |             </div> | ||||||
|         <% } %> |         <% } %> | ||||||
| 
 | 
 | ||||||
|         <form action="login" method="POST"> |         <form action="login" method="POST"> | ||||||
|             <div class="form-group"> |             <div class="form-group"> | ||||||
|                 <label for="password">Password</label> |                 <label for="password"><%= t("login.password") %></label> | ||||||
|                 <div class="controls"> |                 <div class="controls"> | ||||||
|                     <input id="password" name="password" placeholder="" class="form-control" type="password"> |                     <input id="password" name="password" placeholder="" class="form-control" type="password"> | ||||||
|                 </div> |                 </div> | ||||||
| @ -28,12 +28,12 @@ | |||||||
|             <div class="form-group"> |             <div class="form-group"> | ||||||
|                 <div class="checkbox"> |                 <div class="checkbox"> | ||||||
|                     <label> |                     <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> |                     </label> | ||||||
|                 </div> |                 </div> | ||||||
|             </div> |             </div> | ||||||
|             <div class="form-group"> |             <div class="form-group"> | ||||||
|                 <button class="btn btn-success">Login</button> |                 <button class="btn btn-success"><%= t("login.button") %></button> | ||||||
|             </div> |             </div> | ||||||
|         </form> |         </form> | ||||||
|     </div> |     </div> | ||||||
|  | |||||||
| @ -90,5 +90,13 @@ | |||||||
|     "force-save-revision": "Force creating / saving new note revision of the active note", |     "force-save-revision": "Force creating / saving new note revision of the active note", | ||||||
|     "show-help": "Shows built-in Help / cheatsheet", |     "show-help": "Shows built-in Help / cheatsheet", | ||||||
|     "toggle-book-properties": "Toggle Book Properties" |     "toggle-book-properties": "Toggle Book Properties" | ||||||
|  |   }, | ||||||
|  |   "login": { | ||||||
|  |     "title": "Login", | ||||||
|  |     "heading": "Trilium login", | ||||||
|  |     "incorrect-password": "Password is incorrect. Please try again.", | ||||||
|  |     "password": "Password", | ||||||
|  |     "remember-me": "Remember me", | ||||||
|  |     "button": "Login" | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | |||||||
| @ -93,5 +93,13 @@ | |||||||
|     "unhoist": "Defocalizează complet", |     "unhoist": "Defocalizează complet", | ||||||
|     "zoom-in": "Mărește zoom-ul", |     "zoom-in": "Mărește zoom-ul", | ||||||
|     "zoom-out": "Micșorează zoom-ul" |     "zoom-out": "Micșorează zoom-ul" | ||||||
|  |   }, | ||||||
|  |   "login": { | ||||||
|  |     "button": "Autentifică", | ||||||
|  |     "heading": "Autentificare în Trilium", | ||||||
|  |     "incorrect-password": "Parola nu este corectă. Încercați din nou.", | ||||||
|  |     "password": "Parolă", | ||||||
|  |     "remember-me": "Ține-mă minte", | ||||||
|  |     "title": "Autentificare" | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran