Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit d14cf7c

Browse files
committed
i18n: Move translations to backend serve
1 parent 7848914 commit d14cf7c

File tree

4 files changed

+32
-32
lines changed

4 files changed

+32
-32
lines changed

src/public/app/services/i18n.js

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,7 @@ await library_loader.requireLibrary(library_loader.I18NEXT);
44

55
i18next.init({
66
lng: "ro",
7-
debug: true,
8-
resources: {
9-
en: {
10-
translation: {
11-
about: {
12-
title: "About TriliumNext Notes",
13-
homepage: "Homepage:",
14-
app_version: "App version:",
15-
db_version: "DB version:",
16-
sync_version: "Sync version:",
17-
build_date: "Build date:",
18-
build_revision: "Build revision:",
19-
data_directory: "Data directory:"
20-
}
21-
}
22-
},
23-
ro: {
24-
translation: {
25-
about: {
26-
title: "Despre TriliumNext Notes",
27-
homepage: "Site web:",
28-
app_version: "Versiune aplicație:",
29-
db_version: "Versiune bază de date:",
30-
sync_version: "Versiune sincronizare:",
31-
build_date: "Data compilării:",
32-
build_revision: "Revizia compilării:",
33-
data_directory: "Directorul de date:"
34-
}
35-
}
36-
}
37-
}
7+
debug: true
388
});
399

4010
export const t = i18next.t;

src/public/translations/en.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"translation": {
3+
"about": {
4+
"title": "About TriliumNext Notes",
5+
"homepage": "Homepage:",
6+
"app_version": "App version:",
7+
"db_version": "DB version:",
8+
"sync_version": "Sync version:",
9+
"build_date": "Build date:",
10+
"build_revision": "Build revision:",
11+
"data_directory": "Data directory:"
12+
}
13+
}
14+
}

src/public/translations/ro.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"translation": {
3+
"about": {
4+
"title": "Despre TriliumNext Notes",
5+
"homepage": "Site web:",
6+
"app_version": "Versiune aplicație:",
7+
"db_version": "Versiune bază de date:",
8+
"sync_version": "Versiune sincronizare:",
9+
"build_date": "Data compilării:",
10+
"build_revision": "Revizia compilării:",
11+
"data_directory": "Directorul de date:"
12+
}
13+
}
14+
}

src/routes/assets.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ function register(app: express.Application) {
7070

7171
app.use(`/${assetPath}/node_modules/panzoom/dist/`, persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/panzoom/dist/')));
7272

73-
app.use(`/${assetPath}/node_modules/i18next/`, persistentCacheStatic(path.join(srcRoot, "..", 'node_modules/i18next/')))
73+
// i18n
74+
app.use(`/${assetPath}/node_modules/i18next/`, persistentCacheStatic(path.join(srcRoot, "..", 'node_modules/i18next/')));
75+
app.use(`/${assetPath}/translations/`, persistentCacheStatic(path.join(srcRoot, "public", "translations/")));
7476
}
7577

7678
export = {

0 commit comments

Comments
 (0)