summary refs log tree commit diff
path: root/src/api/middlewares/Translation.ts
diff options
context:
space:
mode:
authorEmma [it/its]@Rory& <root@rory.gay>2023-12-11 01:12:54 +0100
committerEmma [it/its]@Rory& <root@rory.gay>2023-12-11 01:12:54 +0100
commit0a8ceb9e6349284e75545a01ffad608b020f78e2 (patch)
tree17a9163f963eddabf9168b0b630096b2f7535b64 /src/api/middlewares/Translation.ts
parentPrettier: use editorconfig (diff)
downloadserver-dev/emma-refactors.tar.xz
Actually run prettier dev/emma-refactors
Diffstat (limited to '')
-rw-r--r--src/api/middlewares/Translation.ts12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/api/middlewares/Translation.ts b/src/api/middlewares/Translation.ts

index f3a4c8df..e089407e 100644 --- a/src/api/middlewares/Translation.ts +++ b/src/api/middlewares/Translation.ts
@@ -27,12 +27,8 @@ const ASSET_FOLDER_PATH = path.join(__dirname, "..", "..", "..", "assets"); export async function initTranslation(router: Router) { const languages = fs.readdirSync(path.join(ASSET_FOLDER_PATH, "locales")); - const namespaces = fs.readdirSync( - path.join(ASSET_FOLDER_PATH, "locales", "en"), - ); - const ns = namespaces - .filter((x) => x.endsWith(".json")) - .map((x) => x.slice(0, x.length - 5)); + const namespaces = fs.readdirSync(path.join(ASSET_FOLDER_PATH, "locales", "en")); + const ns = namespaces.filter((x) => x.endsWith(".json")).map((x) => x.slice(0, x.length - 5)); await i18next .use(i18nextBackend) @@ -43,9 +39,7 @@ export async function initTranslation(router: Router) { fallbackLng: "en", ns, backend: { - loadPath: - path.join(ASSET_FOLDER_PATH, "locales") + - "/{{lng}}/{{ns}}.json", + loadPath: path.join(ASSET_FOLDER_PATH, "locales") + "/{{lng}}/{{ns}}.json", }, load: "all", });