From 9669ec376f2db3fe6cbcab73219e5de9bc346aa5 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 21 Jul 2022 01:03:51 +0200 Subject: [PATCH] docker support --- src/utils/client.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/client.ts b/src/utils/client.ts index c2f778d..6ac5a21 100644 --- a/src/utils/client.ts +++ b/src/utils/client.ts @@ -56,8 +56,10 @@ const getLocale = async (client: Client) => { const default_lang = 'en'; // Check if there is a defined valid value + const old_path = __dirname.split('/'); + old_path.pop(); const lang = client.config.lang === undefined ? default_lang : existsSync( - `./src/locales/${client.config.lang}.json`, + `${old_path.join('/')}/locales/${client.config.lang}.json`, ) ? client.config.lang : default_lang; // Fallback to default language in case lang isn't valid