docker support

This commit is contained in:
Mylloon 2022-07-21 01:03:51 +02:00
parent e965115aa4
commit 9669ec376f
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -56,8 +56,10 @@ const getLocale = async (client: Client) => {
const default_lang = 'en'; const default_lang = 'en';
// Check if there is a defined valid value // 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( 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; ) ? client.config.lang : default_lang;
// Fallback to default language in case lang isn't valid // Fallback to default language in case lang isn't valid