From 6142dcae20eef7b864c3c495436e4c510a661c1a Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Tue, 30 Aug 2022 17:05:38 +0200 Subject: testing stuff --- src/api/middlewares/Translation.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/api/middlewares/Translation.ts') diff --git a/src/api/middlewares/Translation.ts b/src/api/middlewares/Translation.ts index 8e5e67e6..85b4ac06 100644 --- a/src/api/middlewares/Translation.ts +++ b/src/api/middlewares/Translation.ts @@ -1,3 +1,4 @@ +import { Paths } from "@fosscord/util"; import { Router } from "express"; import fs from "fs"; import i18next from "i18next"; @@ -6,8 +7,8 @@ import i18nextBackend from "i18next-node-fs-backend"; import path from "path"; export async function initTranslation(router: Router) { - const languages = fs.readdirSync(path.join(__dirname, "..", "..", "..", "assets", "locales")); - const namespaces = fs.readdirSync(path.join(__dirname, "..", "..", "..", "assets", "locales", "en")); + const languages = fs.readdirSync(path.join(Paths.AssetsPath, "locales")); + const namespaces = fs.readdirSync(path.join(Paths.AssetsPath, "locales", "en")); const ns = namespaces.filter((x) => x.endsWith(".json")).map((x) => x.slice(0, x.length - 5)); await i18next -- cgit 1.5.1