summary refs log tree commit diff
path: root/src/api/middlewares/Translation.ts
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/api/middlewares/Translation.ts (renamed from api/src/middlewares/Translation.ts)10
1 files changed, 5 insertions, 5 deletions
diff --git a/api/src/middlewares/Translation.ts b/src/api/middlewares/Translation.ts

index baabf221..8e5e67e6 100644 --- a/api/src/middlewares/Translation.ts +++ b/src/api/middlewares/Translation.ts
@@ -1,13 +1,13 @@ +import { Router } from "express"; import fs from "fs"; -import path from "path"; import i18next from "i18next"; import i18nextMiddleware from "i18next-http-middleware"; import i18nextBackend from "i18next-node-fs-backend"; -import { Router } from "express"; +import path from "path"; export async function initTranslation(router: Router) { - const languages = fs.readdirSync(path.join(__dirname, "..", "..", "locales")); - const namespaces = fs.readdirSync(path.join(__dirname, "..", "..", "locales", "en")); + const languages = fs.readdirSync(path.join(__dirname, "..", "..", "..", "assets", "locales")); + const namespaces = fs.readdirSync(path.join(__dirname, "..", "..", "..", "assets", "locales", "en")); const ns = namespaces.filter((x) => x.endsWith(".json")).map((x) => x.slice(0, x.length - 5)); await i18next @@ -19,7 +19,7 @@ export async function initTranslation(router: Router) { fallbackLng: "en", ns, backend: { - loadPath: __dirname + "/../../locales/{{lng}}/{{ns}}.json" + loadPath: __dirname + "/../../../assets/locales/{{lng}}/{{ns}}.json" }, load: "all" });