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

Commit 10ec7d6

Browse files
committed
i18n: Set up client dependency to i18next
1 parent 33d6d51 commit 10ec7d6

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/public/app/services/i18n.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import library_loader from "./library_loader.js";
2+
3+
await library_loader.requireLibrary(library_loader.I18NEXT);
4+
5+
export const t = i18next.t;

src/public/app/services/library_loader.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ const MARKJS = {
7272
]
7373
};
7474

75+
const I18NEXT = { js: [ "node_modules/i18next/i18next.min.js" ] };
76+
7577
async function requireLibrary(library) {
7678
if (library.css) {
7779
library.css.map(cssUrl => requireCss(cssUrl));
@@ -129,5 +131,6 @@ export default {
129131
FORCE_GRAPH,
130132
MERMAID,
131133
EXCALIDRAW,
132-
MARKJS
134+
MARKJS,
135+
I18NEXT
133136
}

src/routes/assets.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ function register(app: express.Application) {
6969
app.use(`/${assetPath}/node_modules/split.js/dist/`, persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/split.js/dist/')));
7070

7171
app.use(`/${assetPath}/node_modules/panzoom/dist/`, persistentCacheStatic(path.join(srcRoot, '..', 'node_modules/panzoom/dist/')));
72+
73+
app.use(`/${assetPath}/node_modules/i18next/`, persistentCacheStatic(path.join(srcRoot, "..", 'node_modules/i18next/')))
7274
}
7375

7476
export = {

0 commit comments

Comments
 (0)