1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-04-01 21:24:45 +02:00

Server: Setup localisation

This commit is contained in:
Laurent Cozic 2021-12-16 11:07:25 +01:00
parent 9c0982dcab
commit aa42cebbca
3 changed files with 20 additions and 7 deletions

View File

@ -23,6 +23,7 @@ import setupCommands from './utils/setupCommands';
import { RouteResponseFormat, routeResponseFormat } from './utils/routeUtils';
import { parseEnv } from './env';
import storageConnectionCheck from './utils/storageConnectionCheck';
import { setLocale } from '@joplin/lib/locale';
interface Argv {
env?: Env;
@ -261,6 +262,8 @@ async function main() {
appLogger().info('Skipping NTP time check because MAX_TIME_DRIFT is 0.');
}
setLocale('en_GB');
appLogger().info('Running in Docker:', runningInDocker());
appLogger().info('Public base URL:', config().baseUrl);
appLogger().info('API base URL:', config().apiBaseUrl);

View File

@ -8,6 +8,7 @@ import { User } from '../services/database/types';
import { makeUrl, UrlType } from '../utils/routeUtils';
import MarkdownIt = require('markdown-it');
import { headerAnchor } from '@joplin/renderer';
import { _ } from '@joplin/lib/locale';
export interface RenderOptions {
partials?: any;
@ -191,6 +192,15 @@ export default class MustacheService {
const layoutView: any = {
global: globalParams,
s: {
home: _('Home'),
users: _('Users'),
items: _('Items'),
log: _('Log'),
tasks: _('Tasks'),
help: _('Help'),
logout: _('Logout'),
},
pageName: view.name,
pageTitle: view.titleOverride ? view.title : `${config().appName} - ${view.title}`,
contentHtml: contentHtml,

View File

@ -10,23 +10,23 @@
{{#global.owner}}
<div class="navbar-menu is-active">
<div class="navbar-start">
<a class="navbar-item" href="{{{global.baseUrl}}}/home">Home</a>
<a class="navbar-item" href="{{{global.baseUrl}}}/home">{{s.home}}</a>
{{#global.owner.is_admin}}
<a class="navbar-item" href="{{{global.baseUrl}}}/users">Users</a>
<a class="navbar-item" href="{{{global.baseUrl}}}/users">{{s.users}}</a>
{{/global.owner.is_admin}}
<a class="navbar-item" href="{{{global.baseUrl}}}/items">Items</a>
<a class="navbar-item" href="{{{global.baseUrl}}}/changes">Log</a>
<a class="navbar-item" href="{{{global.baseUrl}}}/items">{{s.items}}</a>
<a class="navbar-item" href="{{{global.baseUrl}}}/changes">{{s.log}}</a>
{{#global.owner.is_admin}}
<a class="navbar-item" href="{{{global.baseUrl}}}/tasks">Tasks</a>
<a class="navbar-item" href="{{{global.baseUrl}}}/tasks">{{s.tasks}}</a>
{{/global.owner.is_admin}}
</div>
<div class="navbar-end">
{{#global.isJoplinCloud}}
<a class="navbar-item" href="{{{global.baseUrl}}}/help">Help</a>
<a class="navbar-item" href="{{{global.baseUrl}}}/help">{{s.help}}</a>
{{/global.isJoplinCloud}}
<div class="navbar-item">
<form method="post" action="{{{global.baseUrl}}}/logout">
<button class="button is-dark">Logout</button>
<button class="button is-dark">{{s.logout}}</button>
</form>
</div>
<div class="navbar-item">