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

Commit 5ea35dd

Browse files
committed
i18n: Implement HTTP backend loader
1 parent d4bf162 commit 5ea35dd

File tree

5 files changed

+33
-32
lines changed

5 files changed

+33
-32
lines changed

src/public/app/services/i18n.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@ import library_loader from "./library_loader.js";
22

33
await library_loader.requireLibrary(library_loader.I18NEXT);
44

5-
i18next.init({
6-
lng: "ro",
7-
debug: true
8-
});
5+
await i18next
6+
.use(i18nextHttpBackend)
7+
.init({
8+
lng: "ro",
9+
debug: true,
10+
backend: {
11+
loadPath: `/${window.glob.assetPath}/translations/{{lng}}/{{ns}}.json`
12+
}
13+
});
914

1015
export const t = i18next.t;

src/public/translations/en.json

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

src/public/translations/ro.json

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

0 commit comments

Comments
 (0)